调用application_end [英] calling application_end

查看:72
本文介绍了调用application_end的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在global.asax中的application_end事件不能按原样运行。为了调试,我想从另一个文件调用它,比如通过

按钮调试debug.aspx,例如最终申请。如何从debug.aspx调用

global.asax中的application_end?


谢谢

My application_end event in global.asax is not working as-is. In order
to debug, I want to call it from another file, say debug.aspx through a
button, e.g. "end application". How do I call application_end in
global.asax from debug.aspx?

thanks

推荐答案



我的项目中有问题。 。 。

如何在没有任何确认的情况下关闭所有会话(Session.Abandon)和资源管理器窗口


Hi,
I have a problem, in my project. . .
How can i close the all the Sessions (Session.Abandon) and Explorer Window
with out any Confirmation.


在我的项目中,我试图维护Windows身份验证(基本

身份验证),问题就像当我到达某些页面时,用户将显示
使用Windows身份验证页面和一些图像将不会显示


i虽然像_currUserIdentity = User.Identity.Name.ToString();通过这个

问题正在发生,因为它试图找到每个

时间的用户身份。 。 。

请尽量解决问题,用户不应该把窗口直到

会话超时。 。 。


这里是global.asax中使用的以下代码


-------------- -------------------------------------------------- -----------------------

protected void Session_Start(Object sender,EventArgs e)

{

_currUserIdentity = User.Identity.Name.ToString();

Session [" currUserIdentity"] = _currUserIdentity;


尝试

{

用户usr =新用户();

usr.GetUserByLoginName(_currUserIdentity);

DataSet dsUser = usr.GetDataSet();

if(dsUser.Tables [0] .Rows.Count == 0)

{

Session [" CurrentUserName"] = _currUserName;

Response.Redirect(" UnAuthorisedAccess.aspx");

}

else if(dsUser .Tables [0] .Rows.Count == 1)

{

Session [" CurrentClientID"] =

dsUser.Tables [ 0] .Rows [0] [" ClientID"]。ToString();

会话[" UserID"] =

Convert.ToInt32(dsUser.Tables [0] .Rows [0] [" UserID"]。ToString());

Response.Redirect(" index.aspx");

}

else

{

Session [" UserName"] = dsUser.Tables [0] .Rows [0 ] [" LoginName"]。ToString();

Response.Redirect(" SelectClient.aspx");

}

}

catch(exception ex)

{

Session [" ErrorMessage"] = ex.ToString();

}

}

------------------------------ -------------------------------------------------- -------


还有一件事就是如果用户在会话中然后我想要

要显示的用户消息应该写在

global.asax<<现在我应该在哪里管理>>
In my project i am trying to maintain the Windows Authentication (Basic
Authentication), the problem is like when i get to some pages the user will
be displayed with the Windows authentication page and some images will not
be displayed

i though like "_currUserIdentity = User.Identity.Name.ToString();" by this
the problem is occuring as it is trying to find the User Identity every
time. . .
please try to solve the problem, user should not get the window untill the
session time out. . .

here is the following code used in the global.asax

---------------------------------------------------------------------------------------
protected void Session_Start(Object sender, EventArgs e)
{
_currUserIdentity = User.Identity.Name.ToString();
Session["currUserIdentity"] = _currUserIdentity;

try
{
Users usr=new Users();
usr.GetUserByLoginName(_currUserIdentity);
DataSet dsUser=usr.GetDataSet();
if (dsUser.Tables[0].Rows.Count==0)
{
Session["CurrentUserName"] = _currUserName;
Response.Redirect("UnAuthorisedAccess.aspx");
}
else if(dsUser.Tables[0].Rows.Count == 1)
{
Session["CurrentClientID"] =
dsUser.Tables[0].Rows[0]["ClientID"].ToString();
Session["UserID"] =
Convert.ToInt32(dsUser.Tables[0].Rows[0]["UserID"].ToString());
Response.Redirect("index.aspx");
}
else
{
Session["UserName"] = dsUser.Tables[0].Rows[0]["LoginName"].ToString();
Response.Redirect("SelectClient.aspx");
}
}
catch(Exception ex)
{
Session["ErrorMessage"] = ex.ToString();
}
}
---------------------------------------------------------------------------------------

and one more thing is the if the user is out with the session then i want
the user to be displayed with the message and that should be written in
global.asax << Now where should i manage that >>


" Raghuram" < RV ****** @ gmail.com>在留言中写道

新闻:un ************* @ TK2MSFTNGP10.phx.gbl ...
"Raghuram" <rv******@gmail.com> wrote in message
news:un*************@TK2MSFTNGP10.phx.gbl...
怎么能我关闭所有会话(Session.Abandon)


当你说所有会话时,你的意思是你想(有效地)抛出

所有用户关闭你的网络应用程序......?

和资源管理器窗口没有任何确认。
How can i close the all the Sessions (Session.Abandon)
When you say "all the Sessions", do you mean you want to (effectively) throw
all users off your web application...?
and Explorer Window with out any Confirmation.




嗯 - 再次,究竟是什么你想在这里实现......?



Hmm - again, what exactly are you trying to achieve here...?


这篇关于调用application_end的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆