ramco1917 says:
HttpContext.Current.User.Identity.Name
HttpContext.Current.User.Identity.Name returns the name of the user that is currently logged into the application.
The HttpContext.Current.User.Identity.Name returns null if the user does not exist.
ramco1917 says:
User.Identity.IsAuthenticated
Gets a value indicating whether the request has been authenticated.
It check user status and return true if the request is authenticated otherwise false.
The code uses the IsAuthenticated property to determine whether the current request has been authenticated.
If it has not been authenticated, the request is redirected to Login page where users can enter their credentials into the application.