How do I set a hyperlink to a subdirectory

Discussion in 'ASP .Net Datagrid Control' started by Eva White via .NET 247, Aug 4, 2004.

  1. 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="filename"
    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>
     
    Eva White via .NET 247, Aug 4, 2004
    #1
    1. Advertising

  2. Eva White via .NET 247

    Thomas Dodds Guest

    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" <> wrote in message
    news:%...
    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>
     
    Thomas Dodds, Aug 4, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave Mitchell

    Re: subdirectory settings

    Dave Mitchell, Jul 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    392
    Dave Mitchell
    Jul 15, 2003
  2. VB Programmer
    Replies:
    0
    Views:
    292
    VB Programmer
    Oct 16, 2003
  3. davetichenor
    Replies:
    1
    Views:
    864
    Eliyahu Goldin
    Oct 30, 2006
  4. Ken
    Replies:
    1
    Views:
    397
    Alvin Bruney
    Aug 16, 2003
  5. Dave
    Replies:
    0
    Views:
    970
Loading...

Share This Page