Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VS2005 C# ASP.NET
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 18-Oct-11 16:34pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Comments
MrProgrammer_78 at 18-Oct-11 22:22pm
   
Thanks, but this method will invoke only if user press on btnClose Button
Al Moje at 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,
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You can invoke the method onUnload of the page.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 6,055
1 DamithSL 4,621
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,500
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 19 Oct 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100