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

WebSecurity GetUserId Method

WebSecurity - GetUserId()


WebSecurity Object WebSecurity object


define

GetUserId() The method returns the ID of the specified user.


C# and VB syntax

WebSecurity.GetUserId(

userName

)


Parameters

Parameters Type Description
userName String Username

Return Value

Type Description
Integer

The user ID


Errors and exceptions

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


Notes

The user ID is the primary key of the user information stored in the user database.

It is used to identify the user in the user profile table and the membership table.


Technical data

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

WebSecurity Object WebSecurity object