I am new to membership stuff on asp.net. If I need to create a new user with extra parameter e.g firstname. Should I create a new table for those extra parameters?
If I am not using CreateUserWizard to create user, do I just use Membership.CreateUser to create the user?
Please help
After getting additional user information, such as the first name you can save this information to a custom database table.
A valid point might be storing the information in the profile. But when running through the wizard, the user is not authenticated yet, so you cannot store the information into the profile, as this is available for authenticated users only. Therefore, you either have to store it in a custom database table or include a way for the user to edit the profile after the registration process.
dbo.aspnet_Profile
is the table, insideaspnetdb
database, used by default for storing profiles of the users. So, in case you prefer to store in Profile, After creating the User, load the profile of the newly created user and set the custom info you gathered.Question 2::
Yes, it's not necessary to use
CreateUserWizard
to create a user. Even you can just collect some basic info like: UserName, Password only using 2 TextBoxes and create the user using the various overloaded versions ofMemberShip.CreateUser()
method. Check MSDN. Also, this Link created user with very basic info.