Querystring question

G

grnjeans922

A little guidance, please....

I'm trying to pass info through the querystring method, across 3
pages.

In my first page, it is being sent out using:

if regEx.test(strAskedFor) then
response.redirect("/store/catalog_request_frm.asp?
foundUs="&strAskedFor)

It lands on the second page just fine, I check the value using:

strAskedFor = Request.QueryString("foundUs")
response.write(strAskedFor)

Now here is where I'm stuck.....I'm trying to use this info again,
constructing a link, and after much tinkering,
I'm not sure if this is an acceptable use, or I'm just referencing
this wrong.

<a href="/store/catalog_request_frm.asp?foundUs="&strAskedfor>Send me
a Complete Catalog </a><br /><br />


Any assistance would be greatly appreciated!
 
B

Bob Barrows [MVP]

strAskedFor = Request.QueryString("foundUs")
response.write(strAskedFor)

Now here is where I'm stuck.....I'm trying to use this info again,
constructing a link, and after much tinkering,
I'm not sure if this is an acceptable use, or I'm just referencing
this wrong.

<a href="/store/catalog_request_frm.asp?foundUs="&strAskedfor>Send me
a Complete Catalog </a><br /><br />
Server-side variables are not visible to client-side html. You have to
write the value to the Response. There is a shortcut for doing this:
<%="something"%>
does the same thing as
<%Response.Write "something"%>

Applying this to your html, we get (line breaks added for readability):
a href="/store/catalog_request_frm.asp?foundUs=
 
T

ThatsIT.net.au

A little guidance, please....

I'm trying to pass info through the querystring method, across 3
pages.

In my first page, it is being sent out using:

if regEx.test(strAskedFor) then
response.redirect("/store/catalog_request_frm.asp?
foundUs="&strAskedFor)

It lands on the second page just fine, I check the value using:

strAskedFor = Request.QueryString("foundUs")
response.write(strAskedFor)

Now here is where I'm stuck.....I'm trying to use this info again,
constructing a link, and after much tinkering,
I'm not sure if this is an acceptable use, or I'm just referencing
this wrong.

<a href="/store/catalog_request_frm.asp?foundUs="&strAskedfor>Send me
a Complete Catalog </a><br /><br />


Any assistance would be greatly appreciated!


<a href="/store/catalog_request_frm.asp?foundUs=<%= strAskedfor%> >Send me
a Complete Catalog </a><br /><br />

but a btter way of doing it is to put the value into a session variable


Session("strAskedFor") = Request.QueryString("foundUs")

now on any page you go to you can call
Session("strAskedFor")
 

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,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top