阅读背景:

我们可以像这样在MVC中验证用户吗?如果不是什么问题

来源:互联网 
[HttpPost]

public ActionResult LogOn(LogOnModel model)
{
    if (ModelState.IsValid)
    {
       if (AuthenticateUser(model))`enter code here`
        {
             return View ('HomePage')
        }
        else
        {
            ModelState.AddModelError("", "The user name or password provided is incorrect.");
        }
    }

    return View(model);
}
[HttpPost]

public ActionResult LogOn(LogOnMode



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: