views:

522

answers:

2

I'm about to start building a new asp.net project, and I'm just starting out with the whole thing of SQLMembershipProvider. What I really want to do is to remove the need for a username and just have the key to the user as the email address.

It seems to me that the easiest thing might be to change the stored procedures to just remove the email address from the tables, and when someone does a search by email, just to use the key (I also need to deal with someone changing their email address...

Before I start, does anyone know a pre-rolled example out there. It just seems too common to have to build it.

+1  A: 

You could modify the procedures... or just omit the email or username fields in your forms/ui and use one or the other behind the scenes to populate the other field. This might be duplicate data, but you might find a need to have an email that isn't also the username down the road.

Quintin Robinson
+4  A: 

You don't need to change anything in the provider. Just set the email as user name upon registration and don't provide any means in the UI to change the email address. It'll do the work easily.

Mehrdad Afshari
and of course if you end up needing usernames for people without email for whatever reason - you still have that flexibility
Simon_Weaver