Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Active Server Pages (ASP)
Expertise: Beginner
Jun 29, 1999

Passing Arguments to ASP pages

Question:
I know that when using products like Cold Fusion, you can pass parameters to the page that does the work. Example: [*.cfm]. I have been trying to do this directly with ASP pages, but have not been successful. Can this be done?

Answer:
You can use the QueryString to pass arguments to your ASP page. Say your ASP page (mypage.asp) is expecting to get two values, "arg1" and "arg2". Then you can call your page as follows:


mypage.asp?arg1=value1&arg2=value2

Note:

1. The question mark (?) signifies the start of your argument list.

2. Each argument key-value pair is delimited by the ampersand character (&).

3. Each argument key-value is of the form "name=value".

Inside your ASP page (mypage.asp), you can simply access these variables by using:


var1 = Request("arg1")
var2 = Request("arg2")
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date