Hyperlink NavigateUrl

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!
 
J

John Timney \(Microsoft MVP\)

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>
 
M

Mark Fox

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!
 
J

Jacob Yang [MSFT]

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

Jacob Yang [MSFT]

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

Mark Fox

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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top