I currently have a abstract controller class that I all my controllers inherit from. I want to be able to use the current user (IPrinciple) object in my master page. I read that I could use the contructor of my abstract base controller class, that is I could do something like
public BaseController()
{
ViewData["UserName"] = this.User.Identity.Name;
}
I could then access ViewData["UserName"] etc from my master page. My problem is that this.User is null at this point. Does anybody know of a different approach?
Thanks in advance.