WebSecurity.UserExists Method
Returns a value that indicates whether the specified user exists in the membership database.
Assembly: WebMatrix.WebData (in WebMatrix.WebData.dll)
Parameters
- userName
- Type: System.String
The user name.
Return Value
Type: System.Booleantrue if the username exists in the user profile table; otherwise, false.
| Exception | Condition |
|---|---|
| InvalidOperationException | The SimpleMembershipProvider.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. |