r p

r p

  • NA
  • 343
  • 0

Can't Update Email Id - MembershipUser

Jan 16 2009 7:18 AM
In my site I am trying allow the users to update their Email Id.
When user trys to update his email id it gives an error saying -

The E-mail supplied is invalid.

I am using the following code-

MembershipUser user;
user = Membership.GetUser(HttpContext.Current.User.Identity.Name);
user.Email=txtEmail.Text;
Membership.UpdateUser(user);


This error comes only when there is another user who uses the SAME EMAIL ID.
I am using email id as the user name at the time of registration, BUT I DON'T UPDATE
the login email Id (Username) in this code as you can see it clearly.
Any idea!

Answers (1)