Closing window and Clearing the session

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I'm having a asp.net page.When i'm clicking on the Logout hyperlink i want
to close the window and clear the session.
Actually i have taken LinkButton control and written a javascript function
to close the window.I have attached Javascript function to link button in the
page load using attributes.add method.
In the code behind of the LinkButton click i have mentioned
Session("userid")=Nothing.
But when i'm running my page Java script function is working but the code
behind is not called
Please help me

Thanks
 
The event doesn't reach the server, as you are closing the window
instead of making a postback. Put the script on the page that is sent
back after you have removed the session variable.

Use Session.Remove("userid") to remove the session variable. Or you can
use Session.Abandon to end the session.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top