clear the session

3 posts, 1 answers
  1. Eva
    Eva avatar
    50 posts
    Member since:
    Jun 2010

    Posted 02 Nov 2011 Link to this post

    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. Answer
    Jayesh Goyani
    Jayesh Goyani avatar
    2733 posts
    Member since:
    May 2010

    Posted 03 Nov 2011 Link to this post

    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
  3. Eva
    Eva avatar
    50 posts
    Member since:
    Jun 2010

    Posted 03 Nov 2011 Link to this post

    Thanks Jayesh. You saved my day :).
Back to Top