Membership - get user email
I am using ASP.Net MVC2 with the default membership/profile/role providers, I'd like to access the user email in my ForgotPassword Action to email a new password to the user, but so far I've only been able to get the username (User.Identity.Name).
Am I missing开发者_Go百科 something here?
You need to access user information in MembershipUser class using Membership class, f.ex:
...
MembershipUser u = Membership.GetUser(username);
//u.Email - this is user's email
...
精彩评论