My problem is simple, I would like to make the last column of my gridview to be a download link to a file in local on my computer.
I have my datatable with 3 columns :
User_id, request_id, FilePath
FilePath is the path (string) to the file on my computer, what I've been trying is : In my gridview on the webpage display the 2 first columns (User_id and request_id). On the 3rd column I added a hyperlink field and tried to link it (with the property DataNavigateUrlField) to the content of the column FilePath.
I've ended up with dead links on which i can't even click, they just change color on mouseover.
Any one have a clue about that ? Thanks a lot
try to use this
And read this how to get needed event hyperlink
A possible solution could be to use a
TemplateField
for your Hyperlink column:will create the desired output:
It seems that a
HyperLinkField
does not accept a file path for itsDataNavigateUrlFields
property.I tried to outsmart it by setting the
DataNavigateUrlFormatString
property:but the issue remains and will only produce