& in a querystring (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


dzirkelb1 -> & in a querystring (9/12/2006 14:52:38)

I have a vendor name called P&B. this obviously isn't a good naming convention, but that was set up before I was here.

Anyways, when I create a link to send the P&B to a new address, the querystring gets all messed up cause it stops at the &. What is the %number used to replace the &? Like, %23 is a # sign I think, and %20 is a blank space I think (those might be reversed)




rdouglass -> RE: & in a querystring (9/12/2006 14:58:41)

My favorite ascii conversion chart:

http://www.lookuptables.com/




dzirkelb1 -> RE: & in a querystring (9/12/2006 15:05:58)

I'm not sure that is what I'm looking for. I want to pass it to a link and then use request.querystring to get the value. Currently, it goes like this:

www.somesite.com?Vendor=P&B

When I do a request.querystring("Vendor"), then it comes up as P instead of P&B. I need to replace the & with something. I don't think what you gave me is right as I know the # has a replacement for sure, and each replacement given uses teh # key.




rdouglass -> RE: & in a querystring (9/12/2006 15:37:41)

quote:

What is the %number used to replace the &?


Well, that is what you asked for.[;)]

What I do with a problem character like that is I usually find some text string that wouldn't show up otherwise. I frequently use something like "QQQQ" or "ZZZZ" and just do replace on it going 'in' to the querystring as well as coming 'out'

<a href="myPage.asp?myValue=<%=replace(myValue,"&","QQQQ")%>">Click<a>

and

myValue = replace(Request.querystring("myValue"),"QQQQ","&")

Works for me in many situations since I can't stand dealing with all that ULEncode crap. [:o]




dzirkelb1 -> RE: & in a querystring (9/12/2006 15:46:04)

I think I would rather use the ULEncode than the replace. do you know what it is for the & sign?




rdouglass -> RE: & in a querystring (9/12/2006 15:51:13)

%26




dzirkelb1 -> RE: & in a querystring (9/12/2006 15:53:24)

Awesome, thanks!




rdouglass -> RE: & in a querystring (9/12/2006 15:55:22)

Here's a little quick-n-dirty Encode/Decode page:

http://www.albionresearch.com/misc/urlencode.php




dzirkelb1 -> RE: & in a querystring (9/12/2006 15:57:39)

awesome, thanks a ton




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875