Easy Tutorial
❮ Webpages Intro Control Htmlinputtext ❯

WebSecurity - IsCurrentUser()



Definition

The IsCurrentUser() method compares the provided username with the username of the currently logged-in user.


C# and VB Syntax


Parameters

Parameter Type Description
userName String The username to compare

Return Value

Type Description
Boolean Returns true if the userName matches the logged-in user, otherwise false.

Errors and Exceptions

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


Technical Data

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

❮ Webpages Intro Control Htmlinputtext ❯