Datalist control-hyperlink problem

Discussion in 'ASP .Net' started by mister-Ed, Sep 19, 2007.

  1. mister-Ed

    mister-Ed Guest

    I am displaying subcategories in my datalist, and now I have a
    bizarre thing happen when I add a new subcategory record in my sql
    database, the new subcategory link does not click into the next page.
    When clicking the link, nothing happens!:

    code to link w/querystrings formatted:
    <a href="prov-results1.aspx?county=<
    %#Server.UrlEncode(Request.QueryString("county")) & "&subcat=" &
    Server.UrlEncode((Eval("SubCategory").ToString())) & "&category=" &
    Server.UrlEncode((Eval("Category").ToString())) & "&uregion=" &
    Server.UrlEncode((Eval("uregion").ToString()))%>"><%#
    Eval("SubCategory")%></a>


    url generated for working link:
    http://www.lasvegasunions.info/prov-results1.aspx?county=Clark&subcat...


    a subcat link that i just added, but doesnt work; url generated for
    non-working link:
    http://www.lasvegasunions.info/prov-results1.aspx?county=Clark&subcat...


    when view sourcing in browser, this link works:
    <a href="prov-results1.aspx?
    county=Clark&subcat=Maintenance&category=Autos++++++++++++++++++++++++
    +
    +++++&uregion=lv">Maintenance</a>


    view sourcing in browser, this link does not work:
    <a href="prov-results1.aspx?
    county=Clark&subcat=Auctions&category=Autos&uregion=lv">Auctions</a>
    ....the link that works has spaces/+ signs in it, but I am stripping
    spaces with Server.UrlEncode (?????)


    TIA
    mr. ed
     
    mister-Ed, Sep 19, 2007
    #1
    1. Advertising

  2. mister-Ed

    mister-Ed Guest

    ...tried using the hyperlink/navigateurl method. This produced error
    "server tag not well

    formed"

    <asp:HyperLink id="HyperLink1" runat="server"

    NavigateUrl="prov-results1.aspx?county=<
    %#Server.UrlEncode(Request.QueryString("county")) &

    "&subcat=" & Server.UrlEncode((Eval("SubCategory").ToString())) &
    "&category=" &

    Server.UrlEncode((Eval("Category").ToString())) & "&uregion=" &

    Server.UrlEncode((Eval("uregion").ToString()))%>"><%#
    Eval("SubCategory")%></asp:HyperLink>

    .... I absolutely need these querystrings in this link.

    Ed
     
    mister-Ed, Sep 19, 2007
    #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. Arjen
    Replies:
    0
    Views:
    523
    Arjen
    Aug 4, 2003
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,916
  3. VB Programmer
    Replies:
    3
    Views:
    10,664
    VB Programmer
    Nov 16, 2005
  4. davetichenor
    Replies:
    1
    Views:
    856
    Eliyahu Goldin
    Oct 30, 2006
  5. mister-Ed

    Datalist control problem with hyperlink

    mister-Ed, Sep 20, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    135
    Nathan Sokalski
    Sep 25, 2007
Loading...

Share This Page