Click here to Skip to main content
11,482,402 members (75,036 online)
Rate this: bad
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...
Posted 18-Oct-11 16:34pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


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);
public void Invoke_SignOut()
    // Your code event here todo...

Hope this could help...

Please remember to vote if could help...

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
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...
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You can invoke the method onUnload of the page.

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

Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 19 Oct 2011
Copyright © CodeProject, 1999-2015
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