Monday, March 26, 2012

Set Email address as username

I am wanting to do something similar except I want to remove the UserName field as our database uses the email field to logon.

Of course I would just make the email field as UserName but it requires the email field as well.

So am I going to have to write my own provider just to remove one simple text box?

All help greatly appreciated :)

That seems like a lot of work just to use the email address as the username. Im doing the same thing in my current project, however i'm simply populating both fields with the entered email address. My suggestion would be to use the standard ASP.NET membership provider.
I used the ASP:Wizard control instead and used parameters to pass the values to the database. Thanks though.

ecbruck:

That seems like a lot of work just to use the email address as the username. Im doing the same thing in my current project, however i'm simply populating both fields with the entered email address. My suggestion would be to use the standard ASP.NET membership provider.

What event do you do this and do you have email validation and unique Username working? I was thinking of trying this myself but just using the stock Username and trying to get another validation control working on it for the email check.


That's exactly what I did. I set the UserName to be unique, and I added a RegularExpressionValidator to handle the email address validation. I'm not sure what you are asking in terms of an event, as everything else in the Membership Provider remains the same.

ok great thanks for the fast reply. I thought that you might have to override the event to add the reg exp validation.

0 comments:

Post a Comment