Tuesday, November 03, 2009 11:00:14 PM
in URL passing querystring '&' use for seprate two different variables in url so u don't use 1&2
so u can wnat to get two value passing in query string then try this way
pagename.asp?SWITCH=1,2
and then u will split on comma(,) and get 1 and 2
or u can use this
pass two value then use two different variable as follows
pagename.asp?SWITCH=1&SWITCH2=2 |
BiographyWeb has not submitted biographical details. Site Rank: 16th place - Current Winnings: $0.00
Reply
Reply Using Power Editor
|
Wednesday, November 04, 2009 12:31:29 AM
You would use the same variable name with your multi-values and create the url. However, a note of caution that there is a length limit to the querystring. Instead you would ideally use other ways of communicating between two asp web pages.
And also note that the Ampersand ("&") is used to separates parameters and not to concatenate them.
You can also give the values as comma separated and then use the indices to retrieve each one of them. But again, this is not adviced as it involved code change in the dependant file once the query string changes in your calling code.
If the param in the Querystring is called "myParam" and has the value "a, b, c"; to retrieve all of them you would write, Response.Write Request.QueryString("myParam") And to retrieve each one of them you would do , Response.Write Request.QueryString("myParam")(1) ' would give a Response.Write Request.QueryString("myParam")(2) ' would give b Response.Write Request.QueryString("myParam")(3) ' would give c
also not that in ASP, you could give the same name to the request querystring variables and still retrieve values. Like the following example. http://localhost/webfolder/page1.asp?param1=a¶m1=b¶m1=c
Response.Write Request.QueryString("param1")(1) ' would give a Response.Write Request.QueryString("param1")(2)' would give b Response.Write Request.QueryString("param1")(3)' would give c
|
Biography:-) Site Rank: 21th place - Current Winnings: $0.00
Reply
Reply Using Power Editor
|
Monday, November 09, 2009 2:09:28 AM
BiographyJack has not submitted biographical details. Site Rank: Not applicable - Current Winnings: $0.00
Reply
Reply Using Power Editor
|
|
|