Click here to Skip to main content
15,893,190 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi every body,

I want to execute some code but only when User is signed out,

User can signed out by many reasons:

1= when it press on sign out button.
2= when he close the explorer
3= when he go to another website
4= when session end

that is what i know, may be another reasons cause signed out (if you know tell me)

i want to know if there is some method that is always invoked when User is signed out by any reasons that i mentioned above.

Like Application_AuthenticateRequest method in Global.asax which invoke always every load of any page.

any reply is appreciated...
thanks.
Posted

Hi,

Try this...

// Note this is an  ImageClickEventArgs (image icon)
protected void btnClose_Click(object sender, ImageClickEventArgs e)
{
    Page.GetType().InvokeMember("Invoke_SignOut", System.Reflection.BindingFlags.InvokeMethod, null, Page, null);
    this.Dispose();
}

public void Invoke_SignOut()
{
    // Your code event here todo...
    //...
}


Hope this could help...

Please remember to vote if could help...

Regards,
Algem
 
Share this answer
 
Comments
MrLonely_2 18-Oct-11 22:22pm    
Thanks, but this method will invoke only if user press on btnClose Button
Al Moje 18-Oct-11 22:53pm    
Yes..
That's right. Maybe you could browse some articles at code project. I had forgotten the link, but some times I read such article closing the explorer or may you find it on google...
Regrds,
You can invoke the method onUnload of the page.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900