标签:end blog void 取值 解决 user tpc entity use
Global.asax界面添加如下方法:
void FormsAuthentication_Authenticate(object sender, FormsAuthenticationEventArgs e) { string UserName = this.Context.Request.QueryString["UserName"]; if (!string.IsNullOrEmpty(UserName)) { FormsAuthentication.SetAuthCookie(UserName, true); e.User = new GenericPrincipal(new GenericIdentity(UserName), null); return; } }
MVC绕过登陆界面验证时HttpContext.Current.User.Identity.Name取值为空问题解决方法
标签:end blog void 取值 解决 user tpc entity use
原文地址:http://www.cnblogs.com/byfcumt/p/6846600.html