public static ValidateUser ( string username, string password ) : bool | ||
username | string | |
password | string | |
Результат | bool |
public static bool ValidateUser (string username, string password)
{
return Provider.ValidateUser (username, password);
}
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { var loginVm = new LoginVm(); if (TryUpdateModel(loginVm, new FormValueProvider(ModelBindingExecutionContext)) && (UserManager.ValidateUser(loginVm.Username, loginVm.Password) && ModelState.IsValid)) { FormsAuthentication.RedirectFromLoginPage(loginVm.Username, false); } } else if (Request.IsAuthenticated) { Response.StatusCode = 403; Response.SuppressContent = true; Context.ApplicationInstance.CompleteRequest(); } }