Ampersand problem

R

Rodusa

I am having problems to use Response.Redirect(URL) with this URL below.
The problem happens only with 1319&

string URL =
"default.aspx?contactid=C6UJ9A000R9D&uidcustomquote=1319&quoteuserid=ADMIN&slxuserid=ADMIN";


I try to response.write(URL) and I get this as a result
default.aspx?contactid=C6UJ9A000R9D&uidcustomquote=1319"euserid=ADMIN&slxuserid=ADMIN


I obtained the querystring of this URL with
Request.ServerVariables("QUERY_STRING") and I tried to encode it with
Server.URLEncode, however I still get the same URL above. It is really
weird because the other parameters seem to be ok.

Please help

Rod
 
J

Juan T. Llibre

The problem is that "&quot" is being interpreted as " .

Try
string URL =
"default.aspx?contactid=C6UJ9A000R9D&uidcustomquote=1319&userid=ADMIN&slxuserid=ADMIN";

You may have to change your parameter's name from
quoteuserid to userid, or any other name *but* quoteuserid.
 
R

Rodusa

Steve,

I did try encoding with Server.URLEncode. However, I can only encode
the parameters individually because when I encode the whole QueryString
via Request.ServerVariables["QUERY_STRING"] it messes up the (=)
making the URL invalid. The easier way is what Juan suggested: to
change the param name uidcustomquote to something else.

I appreciate your suggestions


Rod
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top