关于Global和User.Identity.IsAuthenticated的问题,急死
在用户登陆后
if (Membership.ValidateUser(strUserName, strUserPwd))
{
//验证成功后用户信息写入cookie
FormsAuthentication.SetAuthCookie(strUserName, true);
Login_acpt.arrP =pcls.GetPower(strUserName);
Response.Redirect("~/main.html");
//Response.Write(User.Identity.Name);
}
测试过Response.Write(User.Identity.Name);可以输出用户名
但是在Global的
protected void Application_BeginRequest(object sender, EventArgs e)事件中
User.Identity.Name根本没有实例化,我在这个事件中写权限判断的方法,但是获取不到登陆用户信息,
请问怎么解决