我今天安裝了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