I am fond of the ASP.NET membership provider, it is very simple and easy to use. The default configuration/setup requires a registered user to have a unique username and an email address.

However, in some applications, it is a burden to have users remember a username which may be different from their email address. Also, when a user forgets their password, they can only retrieve it by remembering their username.

So the requirement of having their username = email is a common and sometimes necessary one.

This is easily accomplished by passing the email as the email and also passing it as the username to the provider function http://msdn.microsoft.com/en-us/library/82xx2e62.aspx  e.g.MembershipUser newUser =

OLD

Membership.CreateUser(UsernameTextbox.Text, PasswordTextbox.Text, EmailTextbox.Text, passwordQuestion, passwordAnswer, true, out status);

NEW

Membership.CreateUser(EmailTextbox.Text, PasswordTextbox.Text, EmailTextbox.Text, passwordQuestion, passwordAnswer, true, out status);

Or by using the HTML markup, you can simply change your username field to a "Confirm Email" field and use a ASP.NET Comparer Validator control to ensure that both values match.

 

Happy coding!