How do I insert another column while creating a New user using CreateUserWizard?

L

Learner

Hello,
I am using CreateUserWizard control to create new users on our
website. The creation of New users process is blistering and I have no
problem with it. But we have a need to create (store) a value called
DealerShipID in another table called Users in our database (not in the
aspnetdb). In this Users table I need to push this DealerShipID value
at the same time when a New User is created along with the UserID that
was created in the dbo.aspnet_Users to maintain the relationship
between the Users table in our database and aspnetdb database.

To accomplish the above task my idea is to create an additonal text box
in the CreateUserWizard by clicking 'Customize Create User Setup'
option in the smart window for the Users to enter a their DealerShipID.

And in the code behind page in the 'CreateUserWizard1_CreatedUser'
event to capture the DealerShipID and also get the UserID from the
aspnet_Users table and insert these two values into our Users table.


Please respond if I am thinking it right to accomplish this task. If
not please suggest me the right way of accomplishing this.

If my of doing it right please advise how do I get the UserID that is
just entered into the aspnet_Users table?


Thanks in advance,
-L
 
J

jfkrueger

HI there,

You need to change the control to a template, this allows you to add
fields. Your other assumption about using the CreatedUser event is
correct. To get the value, you need to do something like this:

Dim strNewField As String
Dim objTextBox As TextBox
objTextBox =
CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("TestField")
strNewField = objTextBox.Text

Hope that helps!

Joe Krueger
 

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,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top