Gridview question

  • Thread starter Thread starter Mike P
  • Start date Start date
M

Mike P

I have a gridview and I want to use one of the fields as a link to
download a file e.g. One of my fields is a path to a file that the user
can download such as \\server\files\1.mp3.

How do I allow the viewer to view the path and to download it? I have
tried using hyperlinkfield but DataNavigateUrlFields requires an actual
path rather than a string that represents a path.
 
I have a gridview and I want to use one of the fields as a link to
download a file e.g. One of my fields is a path to a file that the user
can download such as \\server\files\1.mp3.

How do I allow the viewer to view the path and to download it?  I have
tried using hyperlinkfield but DataNavigateUrlFields requires an actual
path rather than a string that represents a path.

*** Sent via Developersdexhttp://www.developersdex.com***

Hi Mike

I hope I'm not stating the obvious here but the Text property of a
hyperlink is separate from NavigateUrl. Does that give you a clue?
 
Yes, I have used the text property to show the path, but how do I
provide a link to it?

<asp:hyperlinkfield headertext="Listen"
datatextfield="calFullPath"
NavigateUrl="calFullPath" />

This just gives a hyperlink http://localhost/appname/calFullPath, when
what I want as the hyperlink is the actual value of calFullPath, for
example \\server\files\1.mp3.
 
Back
Top