I am trying to set and save an email change using within the Membership Provider in ASP.NET MVC 3. I do not know how to properly set and change the email property within th
Try UpdateUser:
var user = Membership.GetUser(id);
user.Email = "new@email.com";
Membership.UpdateUser(user);
I'd like to emphasise a point, following on from @Ecnalyr and @jwaern. When changing the email address, assigning the email address directly as follows did not work:
System.Web.Security.Membership.GetUser.email = newEmail '(this won't work)
First, as shown in the responses above, one must assign the MembershipUser to a variable, and only then affect an UpdateUser on that variable.
Dim mu As MembershipUser = System.Web.Security.Membership.GetUser
mu.Email = email
Membership.UpdateUser(mu)