Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

WebSecurity UserExists Method

WebSecurity - UserExists()


WebSecurity Object WebSecurity object


define

UserExists() The method indicates whether the user already exists in the WebSecurity database.


C# and VB syntax

WebSecurity.UserExists(

userName

)


Parameters

Parameters Type Description
userName String Username

Return Value

Type Description
Boolean Returns if the user already exists true; otherwise, returns false。

Errors and exceptions

In the following cases, any access to the WebSecurity object will throw an InvalidOperationException:


Notes

UserExists() The method only verifies whether the user exists in the user profile table.

ItIt does notverify for the user whether the membership account already exists, or whether the user is confirmed, or whether the user is logged in.


Technical data

Name Value
Namespace WebMatrix.WebData
Assembly WebMatrix.WebData.dll

WebSecurity Object WebSecurity object