最近小弟遇到一个难解的问题,我利用HttpModule做权限判断,当session 为空时调到登录页,但是在使用了ajax的页面,当session过期后页面仍能操作,不能跳转到登陆页 。代码如下
//判断是否.aspx请求
if ((extendedName == "aspx") && (lastPath != "loginpage.aspx") &&
(lastPath != "signout.aspx") && (lastPath != "imgvode.aspx") && (lastPath != "errorpage.aspx") && (lastPath != "carmonitor.aspx") && (lastPath != "mapassign.aspx") && (lastPath != "historytrack.aspx" && lastPath != "driverpictureupload.aspx"))
{
if (appl.Context.Session["USER"] == null)
{
appl.Context.Response.Write("<script language='javascript'>window.top.location.href='../SignOut.aspx';</script>");
appl.Context.Response.End();
}
}
else if (extendedName == "ashx" && lastPath != "prototype.ashx" && lastPath != "core.ashx" && lastPath != "converter.ashx" && lastPath.Split(',')[0] != "loginpage" && lastPath.Split(',')[0] != "signout")
{
}
求达人赐教