Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: ASP within JS

  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Location
    UK
    Posts
    102
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP within JS

    I would search the forum but it wouldn't let me search for asp, anyho, I have this function.

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

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

    and i would like to set an asp session variable in this, this is normally done by using <% session("User1")=variable%>, the thing is, 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.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can't set the variable until you redirect (since javascript is client-side, and ASP is server-side)... then on the server-side you can get the user value from the querystring... i.e. User=whatever.

    Please don't cross-post...
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •