Google Answers Logo
View Question
 
Q: Passing a Parameter - without database, using ASP ( Answered 5 out of 5 stars,   0 Comments )
Question  
Subject: Passing a Parameter - without database, using ASP
Category: Computers > Programming
Asked by: webdesignguy-ga
List Price: $7.00
Posted: 21 Dec 2002 06:17 PST
Expires: 20 Jan 2003 06:17 PST
Question ID: 132126
I have a number of catalog pages on a site (running on Windows 2000
Server, with IIS) - it shows a full version of a printed catalog page.
 I have enlarged most of the sections of the catalog page and have
them stored as separate jpgs (might be 10 enlarged sections for each
catalog page).

I would like to use a single page to display all of the enlarged
pictures (and then use java history-1 to get back).

From the large catalog page, I would like them to be able to simply
click on the portion of the picture that they want enlarged and it
would send them to the template page and pass the link along the way.

For example, from the catalog page:
Link would be www.mysite.com/zoom-in-page.asp?Picture=1a.jpg
Link would be www.mysite.com/zoom-in-page.asp?Picture=1b.jpg  etc.

I would manually construct the links based on the image maps on the
catalog page - that is no sweat.

Question:

On the page:  www.mysite.com/zoom-in-page.asp - how would I retrieve
the "Picture=" parameter being passed along from the sending page?

I need the "Picture=" value to be able to build the link for the
picture.  ie. (img src=/images/"picture=").

I have done this when using a form and database to pass the
information back and forth between the pages, but I would like to
eliminate the need for a database on this site.

Thanks,

WebDesignGuy
Answer  
Subject: Re: Passing a Parameter - without database, using ASP
Answered By: cerebrate-ga on 21 Dec 2002 07:51 PST
Rated:5 out of 5 stars
 
Dear webdesignguy-ga,

The parameters you pass in the URL of a page:

www.mysite.com/zoom-in-page.asp?Picture=1a.jpg

are made available to your ASP code as the QueryString collection in
the Request object. You can access these values from your code in this
manner (examples in VBScript):

picname = Request.QueryString ("Picture")

would set the variable "picname" to the value of the "Picture"
parameter, "1a.jpg". In your application, you could build the links
you need directly with:

<img src="/images/<% =Request.QueryString ("Picture") %>">

You can also specify simply:

picture = Request ("Picture")

which will have the same effect, but after searching through the
parameters specified in the URL, will also search for values posted
from a form, cookies, client certificate fields, and server variables,
where relevant.

If you would prefer to use a form to send the data rather than place
it in the URL, you can use the Form collection of the Request object
in exactly the same manner.

(This information was taken from:

ASP in a Nutshell, A. Keyton Weissinger,
O'Reilly & Associates, 1999)

Additional Links:

"QueryString", ASP Reference
http://www.sloppycode.net/asp/?m=15

"QueryString Collection"
http://www.w3schools.com/asp/coll_querystring.asp

"ASP the querystring"
http://www.stickysauce.com/tutorials/programming/asp/string.htm

If this answer isn't quite what you're looking for, please feel free
to
request a clarification.
 
Hope this helps, 
 
cerebrate-ga 

Search Strategy:

ASP querystring - ://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=ASP+querystring
webdesignguy-ga rated this answer:5 out of 5 stars and gave an additional tip of: $2.50
Perfect - Just what I needed.  I knew it was something like that, but
couldn't quite remember/figure it out.  Thanks for the very fast
response and the links.

Best regards,

WebDesignGuy

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy