Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. open a file

open a file

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelp
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jayesh Talsaniya
    wrote on last edited by
    #1

    hi, can anybody help me out to open a word,txt and xls file respective to file type through asp.net web page using hyperlink. inshort have a list of file, i want a link on each filename that can open it. I tried with the hard path like E:\.. but it doesnt work. Jayesh Talsaniya

    C 1 Reply Last reply
    0
    • J Jayesh Talsaniya

      hi, can anybody help me out to open a word,txt and xls file respective to file type through asp.net web page using hyperlink. inshort have a list of file, i want a link on each filename that can open it. I tried with the hard path like E:\.. but it doesnt work. Jayesh Talsaniya

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      If you just link to it, and send it down via the link with the right MIME type, it should just open in the browser

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      J 1 Reply Last reply
      0
      • C Christian Graus

        If you just link to it, and send it down via the link with the right MIME type, it should just open in the browser

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        J Offline
        J Offline
        Jayesh Talsaniya
        wrote on last edited by
        #3

        may i please have some hard code help as i am not aware how to specify mime type.

        S S 2 Replies Last reply
        0
        • J Jayesh Talsaniya

          may i please have some hard code help as i am not aware how to specify mime type.

          S Offline
          S Offline
          Sathesh Sakthivel
          wrote on last edited by
          #4

          There is anArticle by Michela here in CP. Open a FIle[^] Hope this Article will help you.

          Regards, Satips.:rose:

          1 Reply Last reply
          0
          • J Jayesh Talsaniya

            may i please have some hard code help as i am not aware how to specify mime type.

            S Offline
            S Offline
            szukuro
            wrote on last edited by
            #5

            Response.TransmitFile("workbook.xls"); Response.ContentType = "application/vnd.ms-excel"; //"application/vnd.ms-word" for .doc, "text/plain" for .txt Response.End();

            J 1 Reply Last reply
            0
            • S szukuro

              Response.TransmitFile("workbook.xls"); Response.ContentType = "application/vnd.ms-excel"; //"application/vnd.ms-word" for .doc, "text/plain" for .txt Response.End();

              J Offline
              J Offline
              Jayesh Talsaniya
              wrote on last edited by
              #6

              hi thanx for rplaying but i want to do it on a hyperlink. Jayesh Talsaniya

              S J 2 Replies Last reply
              0
              • J Jayesh Talsaniya

                hi thanx for rplaying but i want to do it on a hyperlink. Jayesh Talsaniya

                S Offline
                S Offline
                Sathesh Sakthivel
                wrote on last edited by
                #7

                Go with Custom Hyperlinks Using Asynchronous Pluggable Protocols. that will be easy.

                Regards, Satips.:rose:

                1 Reply Last reply
                0
                • J Jayesh Talsaniya

                  hi thanx for rplaying but i want to do it on a hyperlink. Jayesh Talsaniya

                  J Offline
                  J Offline
                  Jay_se
                  wrote on last edited by
                  #8

                  Try use LinkButton, instead of HyperLink. LinkButton behaves like a Button control; but looks like a hyperlink.

                  Regards, Jay :)

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups