Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7879059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:49:10+00:00 2026-06-03T03:49:10+00:00

I have this code: <a href=index.asp onclick=<%Session(example) = True%>>LINK</a> The problem is that this

  • 0

I have this 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:49:11+00:00Added an answer on June 3, 2026 at 3:49 am

    All the server code in the page runs on the server before the page is sent to the browser. What you end up with in the browser is just:

    onclick=""
    

    If you want to run server code when an event happens in the browser, you have to make another request to the server. You can either make a postback of the page and send some information back to the server (in querystring/formdata/cookie), or use AJAX to request a different page that contains the server code that you want to run.


    Edit:

    To use a querystring, make a reload of the same page and add for example ?ex=1 to the URL. In the server code you can check for this and set the session:

    If Request.QueryString("ex") = "1" Then
      Session("example") = True
    End If
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this code: $('.access a').toggle(function() { $('link').attr('href', 'styles/accessstyles.css'); $('body').css('font-size', '16px'); }, function() {
I have this line of code: <a href=# id=profilelink name=profilelink value=<?php echo $id./.$block_record;?> onClick=return
I have this code: var fullpath = $(this)[0].src; var a = document.createElement('a'); a.href =
so I have this code for tabs in jquery, the href is set to
HI, I have this code for extracting the href and adding it to a
I have this code that lets me create a custom UIBarButton which is inside
I have index.php like this: <script type=text/javascript src=jquery-1.4.2.js></script> <script type=text/javascript src=ajax.js></script> <a href='one.php' class='ajax'>One</a>
I have this code: $('#checkout').click(function() { $.ajax({ type: 'GET', url: 'index.php?route=payment/quatro/confirm', success: function() {
I have this piece of code: this.json.each(function(obj, index) { var li = new Element('li');
I have a link marked :remote => true that makes a get request to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.