Replacing Username with Email

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
J

Jonathan Wood

I'm using ASP.NET membership functionality.

My problem is that I think I'd rather have each user account keyed on an
email instead of a user name. My main problem with user names is that
duplicates become likely and I don't want people to have to enter a bunch of
different user names before a unique one is found.

I know I can change the prompt of the login control to read email instead of
username. Has anyone done this? Anything else I need to worry about?

BTW, I know there is an option to make emails unique but that wouldn't be
enough for what I want. I want to be able to create new accounts using an
email address and an automatically-generated password.

Thanks.
 
I know I can change the prompt of the login control to read email instead
of
username. Has anyone done this? Anything else I need to worry about?

We made our own registration form and put this code behind the submit
button:

MembershipUser user = Membership.CreateUser(Email.Text, Password.Text,
Email.Text);
Roles.AddUserToRole(user.UserName, "Merchant");
FormsAuthentication.SetAuthCookie(user.UserName, false);

We've had no problems at all with it.
 
Cool, I'll give that a go.

One question: can I ask why you wrote this code instead of just using the
Login control?

Thanks.
 
Jonathan Wood said:
Cool, I'll give that a go.

One question: can I ask why you wrote this code instead of just using the
Login control?

Sorry, you asked about the login control but my answer was talking about
registering a new user. We do use the built-in login control for logging in.
 
Oh, you use the login control, but not the CreateUserWizard control? Is that
right?
 
Oh, you use the login control, but not the CreateUserWizard control? Is
that
right?

Correct. We just wanted a different look & feel for our registration page.
 
Hello Jonathan,
Were you able to use the login control with email instead of the username?
I need to do just that?

Thanks,
Alexis
 
Back
Top