Querystring question

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>




Any assistance would be greatly appreciated!
grnjeans922 [ Di, 18 September 2007 17:30 ] [ ID #1823264 ]

Re: Querystring question

grnjeans922 [at] yahoo.com wrote:
>
> 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>


>
>
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=
<%=strAskedfor%>
>

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
reb01501 [ Di, 18 September 2007 17:43 ] [ ID #1823266 ]

Re: Querystring question

<grnjeans922 [at] yahoo.com> wrote in message
news:1190129446.429510.238040 [at] q3g2000prf.googlegroups.com...
>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>


>
>
> Any assistance would be greatly appreciated!
>


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



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")
me [ Di, 18 September 2007 17:51 ] [ ID #1823267 ]
Webserver » microsoft.public.inetserver.asp.general » Querystring question

Vorheriges Thema: Split Textarea (by lines), trim and save to Database
Nächstes Thema: ASP LDAP Query working on localhost but not webserver