Closing window and Clearing the session

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
 
G

Guest

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top