Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > How do I set a hyperlink to a subdirectory

Reply
Thread Tools

How do I set a hyperlink to a subdirectory

 
 
Eva White via .NET 247
Guest
Posts: n/a
 
      08-04-2004
I am trying to set a field in a Datagrid to open a file locatedin the downloads/ directory on my website. The following codecreates hyperlinks in my datagrid, but when I click on thesehyperlinks, I get "The page cannot be Found" message. Theaddress bar indicates that the links are trying to load a filethat is located in the root of the website.

<asp:HyperLinkColumn DataNavigateUrlField="filename"DataTextField="file name"
HeaderText="File Name" />

How do I specify that I want the hyperlinks to open a file in thesubdirectory?
--------------------------------
From: Eva White

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>cCkBJf0PT0meeQSXEqJ6CA==</Id>
 
Reply With Quote
 
 
 
 
Thomas Dodds
Guest
Posts: n/a
 
      08-04-2004
use the DataNavigateUrlFormatString property ...

<asp:HyperLinkColumn DataNavigateUrlField="filename"
DataTextField="filename" HeaderText="File Name"
DataNavigateUrlFormatString="PUT YOU PATH HERE{0}" />
DataNavigateUrlFormatString="PUT YOU PATH HERE{0}" - what is happening:
{0} will instruct the server to insert the datavalue of the
DataNavigateUrlField as each item is bound ....


"Eva White via .NET 247" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
I am trying to set a field in a Datagrid to open a file located in the
downloads/ directory on my website. The following code creates hyperlinks in
my datagrid, but when I click on these hyperlinks, I get "The page cannot be
Found" message. The address bar indicates that the links are trying to load
a file that is located in the root of the website.

<asp:HyperLinkColumn DataNavigateUrlField="filename"
DataTextField="filename"
HeaderText="File Name" />

How do I specify that I want the hyperlinks to open a file in the
subdirectory?
--------------------------------
From: Eva White

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>cCkBJf0PT0meeQSXEqJ6CA==</Id>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
Macro to Export All Mail in a Subdirectory to .txt Format? Elisa Francesca Roselli Firefox 4 09-08-2005 02:59 PM
Dynamically Hyperlink and Event Handler for the Hyperlink ? Ken ASP .Net Datagrid Control 1 08-15-2003 11:38 PM



Advertisments