Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

WebSecurity - IsCurrentUser()

❮ WebSecurity


The IsCurrentUser() method compares a provided username with the logged in user's username.

C# and VB Syntax



Parameter Type Description
userName String The user name to compare

Return Value

Type Description
Boolean true if the userName parameter matches the logged in user, otherwise false

Errors and Exceptions

Any access to the WebSecurity object throws an InvalidOperationException if:

  • The InitializeDatabaseConnection() method has not been called
  • SimpleMembership is not initialized (or disabled in the website configuration)

❮ WebSecurity