本文介绍了当用户处于活动状态时,我的会话即将到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Geeks !!
我遇到会话问题
即将到期,只要用户处于活动状态并在页面i上工作已经在母版页上制作了这段代码
Hello Geeks !!
I am having problem with session
that is expiring whenever user is active and working something on page i have made this code on master page
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (Session[EmPId] == null)
{
Response.Redirect(~/Default.aspx, false);
}
else
{
Emptr = Convert.ToInt32(Session[EmPId]);
}
}
catch (Exception ex)
{
}
}
在我创建此代码的页面上
on a page i have made this code
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (Session[EmPId] == null)
{
Response.Redirect(~/Default.aspx, false);
}
else
{
Emptr = Convert.ToInt32(Session[EmPId]);
}
}
catch (Exception ex)
{
}
}
和我的web.config文件是这样的
and my web.config file is like this
<sessionState timeout="50000"></sessionState>
我的页面主页面设置在母版页面上
i由于这个问题很麻烦,因为它对用户太刺激了。
提前感谢...
my this page 's master page is set above master page
i am in a big trouble due to this problem as its too irritating for a user.
thanks in advance...
推荐答案
这篇关于当用户处于活动状态时,我的会话即将到期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!