Request.Querystring?

H

Hal Rosser

John . said:
I have a URL in which I am trying to grab its querystring. Its format
looks like this:

http://www.domain.com/page.asp?theURL=http://www.otherdomain.com/otherpa
ge.asp?topic=45&subject=180

My code snippet below:

sURL = Request.QueryString("theUrl")
Response.Write sURL

Gives me this:
http://www.otherdomain.com/otherpage.asp?topic=45

How can I get the whole link (including the &subject=180)?

If you want it all, just access the whole querystring:
Response.write Request.QueryString
I like your example *** a querystring with a URL with a querystring ;-)
that's almost recursive
 
J

Jeff Cochran

I have a URL in which I am trying to grab its querystring. Its format
looks like this:

http://www.domain.com/page.asp?theURL=http://www.otherdomain.com/otherpa
ge.asp?topic=45&subject=180

My code snippet below:

sURL = Request.QueryString("theUrl")
Response.Write sURL

Gives me this:
http://www.otherdomain.com/otherpage.asp?topic=45

How can I get the whole link (including the &subject=180)?

You can't easily. The rest isn't part of "theURL" since it's part of
"subject" in your querystring. The ampersand (&) is a demarcation for
the querystring argument.

Jeff
 
P

PiGei

John . said:
I have a URL in which I am trying to grab its querystring. Its
format looks like this:

http://www.domain.com/page.asp?theURL=http://www.otherdomain.com/otherpa
ge.asp?topic=45&subject=180

My code snippet below:

sURL = Request.QueryString("theUrl")
Response.Write sURL

Gives me this:
http://www.otherdomain.com/otherpage.asp?topic=45

How can I get the whole link (including the &subject=180)?

http://www.domain.com/page.asp?theURL=<%=Server.URLEncode("http://www.otherdomain.com/otherpage.asp?topic=45&subject=180")%>

bye
PGei
 
M

Mark Schupp

The original link must URL encode the "&" before "subject". As far a the
server can tell the link has 2 parameters, "theURL" and "subject".
 

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,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top