首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IE9 FormsAuthentication

IE9 FormsAuthentication
EN

Stack Overflow用户
提问于 2011-03-18 07:34:26
回答 1查看 466关注 0票数 1

我今天安装了IE9,但我的FormsAuthentication停止工作了。我的步骤-在Visual Studio2010中创建ASP.NET MVC2应用程序,向HomeController添加Authorize属性,打开AccontController并注释第44、56、58行。按F5 enter user/user并按ENTER,IE9不会向HomeController发送身份验证cookie

代码语言:javascript
复制
    [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);
    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-03-18 17:03:45

无法复制。对我来说完全没问题。您的设置一定有其他问题。您是否验证了cookies是否已启用?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5346556

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档