HyperLinkField links to Excel files always open in Excel as Read-Only.

Last post 05-15-2008 9:02 AM by daskrabs. 2 replies.

Sort Posts:

  • HyperLinkField links to Excel files always open in Excel as Read-Only.

    05-14-2008, 1:41 PM
    • Member
      10 point Member
    • daskrabs
    • Member since 05-26-2005, 10:12 AM
    • Posts 7

    I have an ASP.net site on an IIS 6 server. On one page, I have a GridView containing a HyperLinkField. This field contains links that point to Excel files on the server, albeit on another drive. The links open properly in Excel when clicked, however the files aways open as Read-Only. I want these files to be writable after they open. The permissions on the directory containing the Excel files is set for full access to Everyone, including the IIS and ASPNET users. Also, when these files are browsed over the network (not via web broswer), they open properly (writable). Why are these files opening Read-Only from a browser?

  • Re: HyperLinkField links to Excel files always open in Excel as Read-Only.

    05-15-2008, 6:06 AM
    Answer
    • Star
      14,342 point Star
    • booler
    • Member since 08-15-2005, 2:22 PM
    • Brighton, England
    • Posts 2,205

     Is the other directory where the excel files are stored mapped as a virtual directory within your app? If not, you can't link to them like this. You can only hyperlink to content which is directly accessible from the web. It may work when you try it locally, but as soon as you deploy the app to a server, and try to access the files, you will find that it fails, as the lonks will be pointing to local resources rather than valid urls.

    If you want to store the files outside of your web app virtual directory structure, you could use linkbuttons instead, and then on postback read the contents of the selected file and write it to the response stream using the Response.TransmitFile method.

  • Re: HyperLinkField links to Excel files always open in Excel as Read-Only.

    05-15-2008, 9:02 AM
    Answer
    • Member
      10 point Member
    • daskrabs
    • Member since 05-26-2005, 10:12 AM
    • Posts 7

    I am already using a virtual directory.

Page 1 of 1 (3 items)