This is a migrated thread and some comments may be shown as answers.

clear the session

2 Answers 112 Views
Window
This is a migrated thread and some comments may be shown as answers.
Eva
Top achievements
Rank 1
Eva asked on 03 Nov 2011, 12:46 AM
How to clear the session variable on window close.
In other words,
After the window close it should clear all the session variable

Any help?

2 Answers, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 03 Nov 2011, 07:58 AM
Hello,

<telerik:RadWindowManager OnClientClose="ClientClose" DestroyOnClose="true">
       
   </telerik:RadWindowManager>
 
 
function ClientClose(oWnd, args) {
            
               __doPostBack('<%= btnClearSession.UniqueID %>', '');
           
       }
 
<asp:Button ID="btnClearSession" runat="server" Text="" OnClick="btnClearSession_Click"
                       Style="display: none" Width="0px" />

protected void btnClearSession_Click(object sender, EventArgs e)
{
    Session.Clear();
        Session.Abandon();
}


Thanks,
Jayesh Goyani
0
Eva
Top achievements
Rank 1
answered on 03 Nov 2011, 06:25 PM
Thanks Jayesh. You saved my day :).
Tags
Window
Asked by
Eva
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Eva
Top achievements
Rank 1
Share this question
or