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
  1. #1
    New Coder
    Join Date
    Jun 2011
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Start asp session OnClick (when click on a link)

    I have this code:

    Code:
    <a href="index.asp" onclick="<%Session("example") = True%>">LINK</a>

    The problem is that this result in the session example will be true when loading this page and not when clicking on the link.

    How can I solve this?

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,901
    Thanks
    79
    Thanked 4,421 Times in 4,386 Posts
    You can't.

    You would have to start the session in the index.asp file, since all session values can only be set and retrieved and cleared in server-side code.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Tags for this Thread

    Posting Permissions

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