title: How does one prevent duplicate email addresses while users modify their email addresses after registration using the default MVC Membership Provider?
body: <p>I am using the default ASP.NET MVC Membership Provider and I would like to allow user's to modify their email after they have created their account.  I do not want users to be able to use a duplicate email.  </p>
  
  <p>How do I allow a user to modify their email and check that the email is not in use elsewhere in the database?  I am not sure of the best way to do this type of check when using the default Membership Provider.</p>
  
  <p>note - I know the Membership Provider itself performs this check when a user attempts to register their email address, I do not know how to perform this check at a later time (due to noobness).</p>
  
  <p>note 2 - I only know of this method of accessing the user's email, is this the proper way to be accessing it?</p>
  
  <pre><code>MembershipUser useremail = Membership.GetUser(User.Identity.Name);
  ViewBag.Email = useremail.Email;
  </code></pre>