System.Web.Security.Membership.ValidateUser C# (CSharp) Method

ValidateUser() public static method

public static ValidateUser ( string username, string password ) : bool
username string
password string
return bool
		public static bool ValidateUser (string username, string password)
		{
			return Provider.ValidateUser (username, password);
		}
		

Usage Example

Example #1
0
 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();
     }
 }
All Usage Examples Of System.Web.Security.Membership::ValidateUser