I want to implement an alert box to alert the current visitor to log in or register to continue browsing in my ASP.net MVC 4 web application. Can someone explain how to check if the current visitor is already a member or logged in?
Some background about my web app:
I appreciate any help.
Try this:
User.Identity.IsAuthenticated
It returns true
if the user is logged in, and false
otherwise.