1
Answer

Can't Update Email Id - MembershipUser

r p

r p

15y
4.7k
1
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)