void Application_PreRequestHandlerExecute(object sender, EventArgs e)
{
if (Request.Path == Request.ApplicationPath + "/login.aspx") return;
int hasright=1;//可以用函数int hasright(Session s){}代替int hasright进行权限判断
if (hasright == 0)//无权限返回登入页面
{
Response.Redirect("~/login.aspx");
}
else
{
}
}