Application_Error函数上的会话错误. [英] Session Error on Application_Error Function.
本文介绍了Application_Error函数上的会话错误.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我已经在Application_Error函数上编写了此代码.
Hi All,
I have written this code on Application_Error function.
SessionsID = HttpContext.Current.Session.SessionID.ToString();
if (Session["USERID"] != null)
{
UserName = Session["USERID"].ToString();
}
谁能告诉我在Application_Error函数的上下文中这是不支持的.
Can any one tell me how this is not support in this context in Application_Error function.
推荐答案
这是您检查的字符串值:
Hi,
Here are u check string value:
SessionsID = HttpContext.Current.Session.SessionID.ToString();
if (Session["USERID"].ToString() != "")
{
UserName = Session["USERID"].ToString();
}
选中此项,在Application_Eror中访问会话变量 [ ^ ]
我想
第一:
Hi,
I think
First:
SessionsID = HttpContext.Current.Session.SessionID.ToString();
if (Session["USERID"].ToString() != string.Empty)
{
UserName = Session["USERID"].ToString();
}
第二:
Second:
SessionsID = HttpContext.Current.Session.SessionID.ToString();
if (Session["USERID"] != null)
{
if(Session["USERID"] != string.Empty)
UserName = Session["USERID"].ToString();
}
这篇关于Application_Error函数上的会话错误.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文