Gridview question

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.
 
S

Stan

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?
 
M

Mike P

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top