How can we add a field to CreateUserWizar

A

ad

I add a field in into Aspnet_Users tables.

How can I add this field to CreateUserWizard?
 
B

Brock Allen

I add a field in into Aspnet_Users tables.

You're not supposed to do that. You should think of the MembershipProviders
as "black boxes", meaning the internal implementation details are not to
knwo known. Also, you're violating the intent of the member ship provider.
It's supposed to be there just as a repository of authentication information.
Add more information unrelated to authentication is breaking the encapsulation.
Plus on top of it all, the provider has no clue that you've added that information
to its store.

What you want to use is the Profile. It allows arbitrary information associated
with a user to be stored in the database. The ProfileProvider has a seperate
role from the MembershipProvider and it's important to keep them distinct.
This was recently discussed on the forums at www.asp.net:

http://forums.asp.net/864182/ShowPost.aspx
How can I add this field to CreateUserWizard?

The CreateUserWizard allows you to add steps, so you can collect any additional
profile data there then handle the CreatingUser event and then save your
additional profile data then.
 
Joined
Aug 13, 2009
Messages
1
Reaction score
0
Add First Name field

Hello,

I faced same problem, I want to add field First Name to the users.
so I modified the webconfig accordingly and I added createuserwizard, and wizardstep and createuserwizardstep tags, and i added a textbox for the First Name.
also in the csharp code I added the first name to the profile successfully.

But this way, the first name is not saved to the DB!
and I need to save it to the DB in order to retrieve it later.

1. is there an automatic way to add the FName field to the aspnet_Users table, or any other table (pls note that I already tried adding an FName field ot aspnet_Users and it didn't store the Fname from the profile's FName property.)
2. as mentioned above in the solution, we should not alter the aspnet_Users table. then to which table should we store the FName? knowing that aspnet_Profile table is empty, it seems we should manually add data to it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top