Is user logged in to .NET Core MVC view?

If you are in a .NET Core MVC view and need to know if a user is logged-in, use the “User.Identity.IsAuthenticated” property:

@if (User.Identity.IsAuthenticated) {
    <input type="button" id="submit" value="Submit"  />
}
  1. Leave a comment

Leave a comment