ASP.NET - HyperLinkField to open up files with its appropriate application.

Asked By Alam Ayoola on 19-Jan-15 11:28 AM
I have been working on GridView, Databound in asp.net and I want to use the HyperlinkField to open up the document displayed on the grid with the appropriate application example, Picture with .jpg, word document with .doc and lots more, Here is My Query string:
 
SelectCommand="SELECT archive, EmpDocId, EmpDocFileName, archive + EmpDocFileName AS FilePath FROM EmpDocuments
And My HyperlinkField:
  <asp:HyperLinkField DataNavigateUrlFields="FIlePath" DataNavigateUrlFormatString="{0}" DataTextField="FilePath" />

But it is not Working its giving me the error:

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    
Robbe Morris replied to Alam Ayoola on 19-Jan-15 04:24 PM
Have you confirmed that the value sent to the browser html is valid and that the url/file is actually accessible from a browser?
Alam Ayoola replied to Robbe Morris on 20-Jan-15 04:13 AM
That is the issue am having now, dont know how to go abt that, Pls can U elp me out pls.
Thanks
Robbe Morris replied to Alam Ayoola on 20-Jan-15 08:39 AM
Just do a view source on the web page and look at what you are passing in the html for that link.