Connecting Tech Pros Worldwide Help | Site Map

Closing window and Clearing the session

srinivas
Guest
 
Posts: n/a
#1: Jun 2 '06
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öran Andersson
Guest
 
Posts: n/a
#2: Jun 2 '06

re: Closing window and Clearing the session


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.

srinivas wrote:[color=blue]
> 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[/color]
Closed Thread


Similar ASP.NET bytes