Click to See Complete Forum and Search --> : ASP question?


waqas1
June 20th, 2002, 02:57 AM
how can i send a variable or a value using Response.Redirect to the redirected asp page...

Thanks

waqas

Zvona
June 20th, 2002, 07:47 AM
This is a forum for client-side scripting ;)

You can pass variables in url, separated by question mark (?) and ampersands (&). httpString data can be accessed with Request(variable_name) method, likewise when processing form data.

For example :
<%
Response.redirect("http://www.domain.com/query.asp?age=22&gender=male")
%>

and query.asp,
either :
<script type="javascript">
var aVariables = location.search.substring(0).split();

// aVariables contains : { [0]: "age=22", [1]: "gender=male" }.
// eval() method helps us to bring values into variables age and gender
for (var iI=0;iI<aVariables.length;iI++)
{
eval(aVariables[iI]);
}
</script>
or :

<%
Dim age, gender
age = Request.Querystring("age")
gender = Request.Querystring("gender")
%>

waqas1
June 22nd, 2002, 12:37 PM
Thanks Zvona