我今天安装了IE9,并且我的FormsAuthentication已停止工作。 我的步骤 - 在Visual Studio 2010中创建ASP.NET MVC2应用程序,向HomeController添加Authorize属性,打开AccontController和注释行44,56,58。点击F5输入用户并点击ENTER,IE9不会向HomeController发送身份验证CookieIE9 FormsAuthentication
[HandleError, Authorize]
public class HomeController : Controller
{
public ActionResult Index()
{
ViewData["Message"] = "Welcome to ASP.NET MVC!";
return View();
}
}
[HttpPost]
public ActionResult LogOn(LogOnModel model, string returnUrl)
{
if (ModelState.IsValid)
{
//if (MembershipService.ValidateUser(model.UserName, model.Password))
{
FormsService.SignIn(model.UserName, model.RememberMe);
if (!String.IsNullOrEmpty(returnUrl))
{
return Redirect(returnUrl);
}
else
{
return RedirectToAction("Index", "Home");
}
}
//else
{
//ModelState.AddModelError("", "The user name or password provided is incorrect.");
}
}
// If we got this far, something failed, redisplay form
return View(model);
}
您有重现此问题的网址吗? – EricLaw 2011-03-18 00:56:29