日期:2014-05-16 浏览次数:22827 次
public void ProcessRequest(HttpContext context) { if (context.Request.Url.AbsolutePath.ToLower().IndexOf(".aspx") > -1) { string myPage = context.Request.Url.Segments[context.Request.Url.Segments.Length - 1].ToLower(); if (myPage.ToLower() != Common.DefaltPage.ToLower() && Common.SessionUserData == null) { context.Response.Write("<script type=\"text/javascript\">alert(\"连接超时,请重新登陆或非正常登陆!\");</script>"); context.Response.Write("<script type=\"text/javascript\">top.location.href='http://" + context.Request.Url.Authority + context.Request.ApplicationPath + Common.DefaltPage + "';</script>"); context.Response.End(); } else { context.Response.Redirect(context.Request.RawUrl, true); //死循环。。。老跑进httphandler里面来 //这个方法可以通过,但是不支持.aspx?xxx的格式,不允许?xxxx格式 //IHttpHandler handle = PageParser.GetCompiledPageInstance(context.Request.RawUrl, context.Request.PhysicalPath, context); //context.Server.Transfer(handle, true); } } }