Session Variable in a Javascript Popup

Discussion in 'ASP General' started by Keith, Jun 23, 2004.

  1. Keith

    Keith Guest

    I have a session variable set on my main page which works fine, I also have
    a popup window called from a text link via javascript.

    For some reason the session variable is not available on the popup window.

    Is this normal?
    Keith, Jun 23, 2004
    #1
    1. Advertising

  2. Yep.
    http://www.aspfaq.com/2172

    Why not call your popup window with something like this:

    <script>
    window.open('somepage.asp?localvar=<%=session("var")%>');
    </script>

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)




    "Keith" <@.> wrote in message news:OiXTJ#...
    > I have a session variable set on my main page which works fine, I also

    have
    > a popup window called from a text link via javascript.
    >
    > For some reason the session variable is not available on the popup window.
    >
    > Is this normal?
    >
    >
    Aaron [SQL Server MVP], Jun 23, 2004
    #2
    1. Advertising

  3. Keith

    Bullschmidt Guest

    Well at least for an alert popup this should work to display a session
    variable:

    Response.Write "<script type='text/javascript'>alert('" &
    Session("MyVar") & "');</script>"

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Designer
    http://www.Bullschmidt.com
    ASP Designer Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Bullschmidt, Jun 24, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Hearn
    Replies:
    2
    Views:
    3,781
    David Hearn
    Apr 25, 2004
  2. dapkniht
    Replies:
    1
    Views:
    1,321
    Eliyahu Goldin
    Mar 8, 2006
  3. chowchho
    Replies:
    7
    Views:
    619
    Patrice
    Mar 28, 2008
  4. Rajesh
    Replies:
    0
    Views:
    520
    Rajesh
    Jul 31, 2007
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    502
    Randy Webb
    Jun 19, 2004
Loading...

Share This Page