Posted on: 7/23/2014 1:28:48 AM | Views : 612

So I have a webforms project I created with the new identity.  I have added first and last name to the ApplicationUser class.  How would I go about accessing these fields on the site master page (without hitting the database again)?  everything I see in tutorials for the new identity is in MVC.  On my page we have a <%:Context.User.Identity.getusername()%>  I would like something like that to retrieve the added fields I have for the user.  Is this possible?
I could probably do the following in the code behind :
var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext())); var currentUser = manager.FindById(User.Identity.getUserid()); return currentUser.firstName; But I would think there would have to be an easier way?  Thoughts?

Thanks!

Go to the complete details ...