Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Replacing Username with Email

0 views
Skip to first unread message

Jonathan Wood

unread,
Nov 16, 2007, 3:02:18 PM11/16/07
to
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.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Scott Roberts

unread,
Nov 16, 2007, 3:10:59 PM11/16/07
to

> 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.

Jonathan Wood

unread,
Nov 16, 2007, 4:40:16 PM11/16/07
to
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
SoftCircuits Programming
http://www.softcircuits.com

"Scott Roberts" <srob...@no.spam.here-webworks-software.com> wrote in
message news:ehJUPzIK...@TK2MSFTNGP05.phx.gbl...

Scott Roberts

unread,
Nov 16, 2007, 4:50:04 PM11/16/07
to

"Jonathan Wood" <jw...@softcircuits.com> wrote in message
news:uHr%23LlJKI...@TK2MSFTNGP02.phx.gbl...

> 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.

Jonathan Wood

unread,
Nov 16, 2007, 5:04:18 PM11/16/07
to
Oh, you use the login control, but not the CreateUserWizard control? Is that
right?

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Scott Roberts" <srob...@no.spam.here-webworks-software.com> wrote in

message news:ezlhmqJK...@TK2MSFTNGP02.phx.gbl...

Scott Roberts

unread,
Nov 16, 2007, 5:17:47 PM11/16/07
to

> 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.

Jonathan Wood

unread,
Nov 16, 2007, 7:24:03 PM11/16/07
to
Yeah, using the email seems to make a lot more sense to me. Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"Scott Roberts" <srob...@no.spam.here-webworks-software.com> wrote in

message news:O3oWF6JK...@TK2MSFTNGP03.phx.gbl...

Alexis

unread,
Dec 11, 2007, 6:07:00 PM12/11/07
to
Hello Jonathan,
Were you able to use the login control with email instead of the username?
I need to do just that?

Thanks,
Alexis

0 new messages