Question

Currently I have a site (asp.net 3.5) that uses a unique ID for the login. I am going to need to switch it to use emails if possible. I am going to be creating all new accounts so I can wipe the membership table clean and import all the user info.

We are switching from generic logins for departments to individual accounts.

Any links or pointers in the right direction would be greatly appreciated.

Was it helpful?

Solution

So here is what you should do. If you are creating a entire user base just wipe of the current ones and tell users to create the new user with a email, as long as you validate that on the entry form you are going to be good. Now if you already have a user base, then is a little more complicated. First verify that every current user has a valid distinct email, then you have to change 2 columns on the aspnet_Users table, the columns are UserName, and LoweredUserName. That should be simple if the first step is true, just do a loop for every aspnetMembership row, get the column Email and set as UserName, then get the column LoweredEmail a set as LoweredUserName.

Ta daaaaaa!

Now you have it all migrated to the new model, for new entries, make sure that the entry form validates the UserName to be an email, for that you can use RegEx.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top