我需要建议,我希望每次退出时都调用方法 [英] I need advice, i want method invoked every signning out
问题描述
大家好,
我想执行一些代码,但仅在用户注销时执行,
用户可以退出的原因有很多:
1 =当按下退出按钮时.
2 =当他关闭资源管理器时
3 =他去另一个网站时
4 =会话结束时
这就是我所知道的,可能是导致登出的另一个原因(如果您知道,请告诉我)
我想知道是否有用户出于上述任何原因退出用户时总是调用某些方法.
就像Global.asax中的Application_AuthenticateRequest方法一样,它总是调用任何页面的每次加载.
任何答复表示赞赏...
谢谢.
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.
推荐答案
试试这个...
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
您可以调用页面的onUnload方法.
You can invoke the method onUnload of the page.
这篇关于我需要建议,我希望每次退出时都调用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!