Ampersand in querystring

J

Joe Fallon

I Googled this topic and everyone says to use Server.UrlEncode.
No sweat - I did that.
Still doesn't work right though!

Could use some advice.

On the page where I build the link I have code like this for Name="A&S".
Hy1.NavigateUrl = "javascript:CenteredWin('MyPage.aspx?keyvalue=" &
Server.UrlEncode(mData.Name) & "','MyPage',600,500);"

This renders as:
<a id="Hyl1"
href="javascript:CenteredWin('MyPage'.aspx?keyvalue=A%26S','MyPage',600,500);">A&S</a>

When I click the link the receiving page tries to get the value from the
querystring:

mName = Request.QueryString("keyvalue")

But instead of mName="A&S" it is only mName="A".

I thought the URLEncoding was supposed to fix this.

Why is it still broken?
 

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

Similar Threads

Ampersand (&) in QueryString 3
Accessing URL encoded querystring vars 4
Ampersand problem 3
German "Umlaute" in QueryString 12
Ampersand in attribute 4
QueryString to Textbox 0
scanf and ampersand 4
QueryString 1

Members online

No members online now.

Forum statistics

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

Latest Threads

Top