Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Hyperlink NavigateUrl

Reply
Thread Tools

Hyperlink NavigateUrl

 
 
Mark Fox
Guest
Posts: n/a
 
      11-03-2003
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!

 
Reply With Quote
 
 
 
 
John Timney \(Microsoft MVP\)
Guest
Posts: n/a
 
      11-03-2003
yes - you can try to set it via a template column

See this for an explanation

http://datawebcontrols.com/faqs/Hype...leQuerystringV
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" <(E-Mail Removed)> wrote in message
news:095d01c3a1e6$5bff8bd0$(E-Mail Removed)...
> 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!
>



 
Reply With Quote
 
 
 
 
Mark Fox
Guest
Posts: n/a
 
      11-04-2003
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/Hype...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" <(E-Mail Removed)> wrote in message
>news:095d01c3a1e6$5bff8bd0$(E-Mail Removed)...
>> 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!
>>

>
>
>.
>

 
Reply With Quote
 
Jacob Yang [MSFT]
Guest
Posts: n/a
 
      11-04-2003
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.

 
Reply With Quote
 
Jacob Yang [MSFT]
Guest
Posts: n/a
 
      11-04-2003
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.

 
Reply With Quote
 
Mark Fox
Guest
Posts: n/a
 
      11-04-2003
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.
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP Hyperlink with absolute NavigateURL? is it possible Amir Eshterayeh ASP .Net 5 02-13-2009 05:12 PM
hyperlink and dynamically formed NavigateURL problem Tomek R. ASP .Net 7 02-13-2009 05:12 PM
HyperLink.NavigateUrl always adds an extra ../ when going to a higher level directory Nathan Sokalski ASP .Net 0 05-29-2005 11:33 PM
HyperLink.NavigateUrl property not marked as virtual Cynic07 ASP .Net 0 05-20-2004 09:23 PM
undesired behavior in setting hyperlink .NavigateURL property Boban Dragojlovic ASP .Net 3 10-29-2003 09:05 PM



Advertisments