WebSecurity.Login(String, String, Boolean)
WebSecurity.Login(String, String, Boolean)
WebSecurity.Login(String, String, Boolean)
Method
Definition
Logs the user in.
public static bool Login (string userName, string password, bool persistCookie = false);
static member Login : string * string * bool -> bool
Public Shared Function Login (userName As String, password As String, Optional persistCookie As Boolean = false) As Boolean
Parameters
(Optional) true to specify that the authentication token in the cookie should be persisted beyond the current session; otherwise false. The default is false.
Returns
Exceptions
The Initialize(String, NameValueCollection) method was not called.-or-The InitializeDatabaseConnection method was not called.-or-The SimpleMembershipProvider membership provider is not registered in the configuration of your site. For more information, contact your site's system administrator.