WebSecurity.IsAuthenticated Property
Gets the authentication status of the current user.
Assembly: WebMatrix.WebData (in WebMatrix.WebData.dll)
Property Value
Type: System.Booleantrue if the current user is authenticated; otherwise, false. The default is false.
The following example shows how to use the IsAuthenticated method to verify that the current user is authenticated.
if (!WebSecurity.IsAuthenticated) { // If this page is accessed before the user logs in, notify the user. <p>You must first log in to access the rest of this page.</p> <p>Click <a href="WebSecurityLogin.cshtml">here</a> to log in.</p> return; }