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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Opening different files from the browser

Opening different files from the browser

Scheduled Pinned Locked Moved ASP.NET
csshelptutorial
4 Posts 2 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.
  • A Offline
    A Offline
    Anuradha612
    wrote on last edited by
    #1

    Hi, I am developing an application which needs to work with the files. In one page, i have a grid view which lists all the files used for my application, i have used hyperlink column in grid view for these filenames. If i click on the filename in the grid view, the file should be opened in the browser (i.e) it should not open the file in its original format (for example if it is a word document, it should not open in MS Word), it should open only in the browser. Files can be of any type - word, excel, ppts, jpegs etc. I have tried using Response.Redirect with full path, but that is not the result, which i am expecting. Can some body help me in this regard. Thanks in Advance Anuradha

    N 1 Reply Last reply
    0
    • A Anuradha612

      Hi, I am developing an application which needs to work with the files. In one page, i have a grid view which lists all the files used for my application, i have used hyperlink column in grid view for these filenames. If i click on the filename in the grid view, the file should be opened in the browser (i.e) it should not open the file in its original format (for example if it is a word document, it should not open in MS Word), it should open only in the browser. Files can be of any type - word, excel, ppts, jpegs etc. I have tried using Response.Redirect with full path, but that is not the result, which i am expecting. Can some body help me in this regard. Thanks in Advance Anuradha

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      I don't think that it is possible. Because decision will be taken by the browser, and ASP.NET can't control it. Why do you need such an option ?

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      A 1 Reply Last reply
      0
      • N N a v a n e e t h

        I don't think that it is possible. Because decision will be taken by the browser, and ASP.NET can't control it. Why do you need such an option ?

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        A Offline
        A Offline
        Anuradha612
        wrote on last edited by
        #3

        Atleast the basic formats like word, excel, power point, pdf docs should be supported, is there any mechanism to do this

        N 1 Reply Last reply
        0
        • A Anuradha612

          Atleast the basic formats like word, excel, power point, pdf docs should be supported, is there any mechanism to do this

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          Anuradha612 wrote:

          Atleast the basic formats like word, excel, power point, pdf docs should be supported, is there any mechanism to do this

          AFAIK, NO. Operating system will be having file extension mappings, which maps file extension to applications which can read that. When a file is opened through browser, browser looks for this application mapping and loads it on the specified application. It is decided by the browser where to load the file, and how to show it. So you can't control it.

          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

          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