Hyperlink NavigateUrl

  • Thread starter Thread starter Mark Fox
  • Start date Start date
M

Mark Fox

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!
 
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>
 
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!
 
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.
 
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,

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!
 
Back
Top