I us this to see if a user is logged in so I can pass a value to a label
If Context.User.Identity.IsAuthenticated Then
Membership.GetUser()
Dim ThisUserID As String = Membership.GetUser.ProviderUserKey.ToString()
Dim ThisUserName As String = Membership.GetUser.ToString()
UserName.Text = ThisUserName
Else
UserName.Text = "You Are Not Logged In"
End If
I use the code to actually retrieve a numeric customer ID from a separate table and not the Username, but the principle is still the same, and you can also add a line to get and display the role if you like.
"Success is the Sum of Small Efforts, Repeated Day in and Day Out - Without Ceasing!"
Robert Hall
CEO and Founder
My Service Solutions, Inc.