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

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

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. VB Programmer
    Replies:
    0
    Views:
    361
    VB Programmer
    Oct 16, 2003
  2. Scott Natwick

    Creating a Form in a subdirectory

    Scott Natwick, Oct 23, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    408
    Scott Natwick
    Oct 24, 2004
  3. =?Utf-8?B?SnVzdGlu?=

    forms authentication in subdirectory

    =?Utf-8?B?SnVzdGlu?=, Nov 5, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,059
    =?Utf-8?B?SnVzdGlu?=
    Nov 6, 2004
  4. Guest
    Replies:
    2
    Views:
    4,115
    Kristofer Gafvert [MVP]
    Sep 8, 2005
  5. Abraham Andres Luna

    subdirectory is using old version of .net

    Abraham Andres Luna, Dec 7, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    501
    Abraham Andres Luna
    Dec 8, 2005
  6. davetichenor
    Replies:
    1
    Views:
    1,093
    Eliyahu Goldin
    Oct 30, 2006
  7. Ken
    Replies:
    1
    Views:
    635
    Alvin Bruney
    Aug 16, 2003
  8. Dave
    Replies:
    0
    Views:
    1,204
Loading...