.net开发的wap页面出现session过期
发布:shine | 发布时间: 2009年2月3日前不久作一个wap页面每隔一段时间不动页面就出现session过期,一直想解决它。
session每次过期都要经过glable文件中的Application_Error方法,在其中验证,判断返回登陆页面就可以了
protected void Application_Error(Object sender, EventArgs e)
{
string URL = HttpContext.Current.Request.Url.ToString ();
if(Server.GetLastError() is HttpUnhandledException)
{
Server.ClearError();
this.Server.Transfer("Login.aspx?ref=viewstate",true);
}
else
{
Server.ClearError();
this.Server.Transfer(URL,true);
}
// Exception objErr = Server.GetLastError().GetBaseException();
// string objInner = Server.GetLastError().InnerException.ToString();
// string strErr = Server.GetLastError().Message.ToString();
// string strSource = Server.GetLastError().Source.ToString();
//
// string strSender = sender.ToString();
// string typeSender = sender.GetType().ToString();
// string strE = e.ToString();
// string typeE = e.GetType().ToString();
// this.Session.Clear();
// this.Application.Clear();
// this.Server.Transfer("Login.aspx?ref=viewstate",true);
}
{
string URL = HttpContext.Current.Request.Url.ToString ();
if(Server.GetLastError() is HttpUnhandledException)
{
Server.ClearError();
this.Server.Transfer("Login.aspx?ref=viewstate",true);
}
else
{
Server.ClearError();
this.Server.Transfer(URL,true);
}
// Exception objErr = Server.GetLastError().GetBaseException();
// string objInner = Server.GetLastError().InnerException.ToString();
// string strErr = Server.GetLastError().Message.ToString();
// string strSource = Server.GetLastError().Source.ToString();
//
// string strSender = sender.ToString();
// string typeSender = sender.GetType().ToString();
// string strE = e.ToString();
// string typeE = e.GetType().ToString();
// this.Session.Clear();
// this.Application.Clear();
// this.Server.Transfer("Login.aspx?ref=viewstate",true);
}
发布:shine | 分类:WAP开发 | 评论:0 | 引用:0 | 浏览:
| TrackBack引用地址
- 相关文章:
asp.net开发wap必备:更好的匹配手机设备 (2009-2-3 11:23:49)
asp.net wap开发问题小结 (2009-2-3 11:16:31)
asp.net开发WAP 使用Openwave V7模拟器 (2009-2-3 11:3:35)
福建省政府门户网站手机版上线 (2009-1-22 21:38:48)
广州市民可用手机上网查公积金 (2009-1-22 21:36:22)
WAP版“中国苏州”开通 (2009-1-22 21:33:42)
WAP网站的硬件环境基础 (2009-1-22 20:43:7)
深圳首创手机WAP网站购票 1月11日正式推出 (2009-1-19 11:13:22)
手机上网用户超一亿 春运催WAP流量创新高 (2009-1-19 11:2:26)
为什么要建手机WAP网站? (2009-1-10 15:27:19)
发表评论
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。





