PDA

View Full Version : JS in ASP Page


Leeus
01-11-2003, 01:14 PM
I posted this in the Javascript forum but you guys would probably know better! I have this JS function, it is a jump menu, and in this I want to set an ASP session variable.

function MM_jumpMenu(targ,selObj,restore){ //v3.0

eval(targ+".location='"+"report.asp?User="+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}

i want to set that variable to selObj.options[selObj.selectedIndex].value, I have never mixed asp/js before so am unaware of any pitfalls, I still want the page to do the redirect but set the variable first.

whammy
01-11-2003, 04:55 PM
You'll have to set the session variable on the NEXT page, since javascript is client-side... since you're already using a querystring, just do:

Session("User") = Request.QueryString("User")

once you post to the server.

Please don't cross-post, this was also posted in the javascript programming forum. :mad: