Hyperlink NavigateUrl

Discussion in 'ASP .Net' started by Mark Fox, Nov 3, 2003.

  1. Mark Fox

    Mark Fox Guest

    Hello,

    When I set a hyperlink server control's NavigateUrl
    to

    Webform.aspx?a=0&b=0

    it outputs

    Webform.aspx?a=0&b=0

    as the href. Is there a reason for this url encoding?
    Is there a way to have it not do this? Thanks!
    Mark Fox, Nov 3, 2003
    #1
    1. Advertising

  2. yes - you can try to set it via a template column

    See this for an explanation

    http://datawebcontrols.com/faqs/Hyperlinks/HyperlinkWithMultipleQuerystringV
    alues.shtml

    --
    Regards

    John Timney (Microsoft ASP.NET MVP)
    ----------------------------------------------
    <shameless_author_plug>
    Professional .NET for Java Developers with C#
    ISBN:1-861007-91-4
    Professional Windows Forms
    ISBN: 1861005547
    Professional JSP 2nd Edition
    ISBN: 1861004958
    Professional JSP
    ISBN: 1861003625
    Beginning JSP Web Development
    ISBN: 1861002092
    </shameless_author_plug>
    ----------------------------------------------

    "Mark Fox" <> wrote in message
    news:095d01c3a1e6$5bff8bd0$...
    > Hello,
    >
    > When I set a hyperlink server control's NavigateUrl
    > to
    >
    > Webform.aspx?a=0&b=0
    >
    > it outputs
    >
    > Webform.aspx?a=0&amp;b=0
    >
    > as the href. Is there a reason for this url encoding?
    > Is there a way to have it not do this? Thanks!
    >
    John Timney \(Microsoft MVP\), Nov 3, 2003
    #2
    1. Advertising

  3. Mark Fox

    Mark Fox Guest

    John,

    The link you provided explains how to use the
    Datagrid's template column. I am not using the hyperlink
    in a datagrid and even if I was it still doesn't seem to
    explain how to tell ASP.NET to not UrlEncode the Navigate
    Url property, since the text being sent to property would
    still get UrlEncoded whether put together in a template
    column or set programatically in the code behind (as my
    code is doing). Do you know how to stop ASP.NET from
    UrlEncoding the href? Thanks!

    >-----Original Message-----
    >yes - you can try to set it via a template column
    >
    >See this for an explanation
    >
    >http://datawebcontrols.com/faqs/Hyperlinks/HyperlinkWithM

    ultipleQuerystringV
    >alues.shtml
    >
    >--
    >Regards
    >
    >John Timney (Microsoft ASP.NET MVP)
    >----------------------------------------------
    ><shameless_author_plug>
    >Professional .NET for Java Developers with C#
    > ISBN:1-861007-91-4
    >Professional Windows Forms
    > ISBN: 1861005547
    >Professional JSP 2nd Edition
    > ISBN: 1861004958
    >Professional JSP
    > ISBN: 1861003625
    >Beginning JSP Web Development
    > ISBN: 1861002092
    ></shameless_author_plug>
    >----------------------------------------------
    >
    >"Mark Fox" <> wrote in message
    >news:095d01c3a1e6$5bff8bd0$...
    >> Hello,
    >>
    >> When I set a hyperlink server control's

    NavigateUrl
    >> to
    >>
    >> Webform.aspx?a=0&b=0
    >>
    >> it outputs
    >>
    >> Webform.aspx?a=0&b=0
    >>
    >> as the href. Is there a reason for this url encoding?
    >> Is there a way to have it not do this? Thanks!
    >>

    >
    >
    >.
    >
    Mark Fox, Nov 4, 2003
    #3
  4. Hi Mark,

    Thank you for posting to the MSDN newsgroups. We are acknowledging your
    post and you should receive response from the community within 2 business
    days of your post.

    If you have any concerns, please feel free to let us know.

    Best regards,

    Jacob Yang
    Microsoft Online Partner Support
    Get Secure! ¨C www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.
    Jacob Yang [MSFT], Nov 4, 2003
    #4
  5. Hi Mark,

    As I understand, we can reproduce the problem with the following steps:

    1. Create a default web application.

    2. Add a HyperLink asp control to the web form.

    3. In the properties window, set the NavigateUrl to "Webform1.aspx?a=0&b=0".

    4. In the HTML View, we will see that the NavigateUrl is
    "Webform1.aspx?a=0&amp;b=0".

    The reason of converting a string into an HTML-encoded string is for
    reliable HTTP transmission from the Web server to a client. We can build
    and run the web application. When click the HyperLink, we can see the
    correct Url in the Address bar - "Webform1.aspx?a=0&b=0".

    Does it answer your question? If I have misunderstood your concern, please
    feel free to let me know.

    Best regards,

    Jacob Yang
    Microsoft Online Partner Support
    Get Secure! ¨C www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.
    Jacob Yang [MSFT], Nov 4, 2003
    #5
  6. Mark Fox

    Mark Fox Guest

    Jacob,

    Thank you for your response. Yes, it exactly
    answered my question! As long as all browsers (not just
    Internet Explorer) recognize the encoding, it shouldn't
    be a problem. Thanks for your help!

    >-----Original Message-----
    >Hi Mark,
    >
    >As I understand, we can reproduce the problem with the

    following steps:
    >
    >1. Create a default web application.
    >
    >2. Add a HyperLink asp control to the web form.
    >
    >3. In the properties window, set the NavigateUrl

    to "Webform1.aspx?a=0&b=0".
    >
    >4. In the HTML View, we will see that the NavigateUrl is
    >"Webform1.aspx?a=0&b=0".
    >
    >The reason of converting a string into an HTML-encoded

    string is for
    >reliable HTTP transmission from the Web server to a

    client. We can build
    >and run the web application. When click the HyperLink,

    we can see the
    >correct Url in the Address bar - "Webform1.aspx?a=0&b=0".
    >
    >Does it answer your question? If I have misunderstood

    your concern, please
    >feel free to let me know.
    >
    >Best regards,
    >
    >Jacob Yang
    >Microsoft Online Partner Support
    >Get Secure! ¨C www.microsoft.com/security
    >This posting is provided "as is" with no warranties and

    confers no rights.
    >
    >.
    >
    Mark Fox, Nov 4, 2003
    #6
    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. Boban Dragojlovic
    Replies:
    3
    Views:
    3,024
    vMike
    Oct 29, 2003
  2. Amir Eshterayeh
    Replies:
    5
    Views:
    9,320
    Sobot
    Feb 13, 2009
  3. Cynic07
    Replies:
    0
    Views:
    404
    Cynic07
    May 20, 2004
  4. Tomek R.
    Replies:
    7
    Views:
    8,174
    Sobot
    Feb 13, 2009
  5. Nathan Sokalski
    Replies:
    0
    Views:
    718
    Nathan Sokalski
    May 30, 2005
Loading...

Share This Page