I am new to ASP.Net Core and have a custom PageModel (MTNCBasePageModel) that inherits from the PageModel abstract class.
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace WebApp.SharedKernal
{
public class MTNCBasePageModel : PageModel
{
public bool IsAuthenticated = false;
public bool IsEditor = false;
public bool IsAdmin = false;
public MTNCBasePageModel() : base()
{
IsAuthenticated = User.Identity.IsAuthenticated;
}
}
}
When the MTNCBasePageModel constructor is called the User is null.
What am I missing here?
New contributor
RMayerik is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.