Click here to Skip to main content
11,926,933 members (54,644 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET
how to edit the register form for aspnetdb table and add security question, address and mobile number to the following code?

<asp:CreateUserWizard ID="RegisterUser" runat="server" EnableViewState="false" 
        OnCreatedUser="RegisterUser_CreatedUser" ForeColor="White">
            <asp:PlaceHolder ID="wizardStepPlaceholder" runat="server"></asp:PlaceHolder>
Posted 20-Apr-13 12:10pm
Edited 20-Apr-13 12:56pm
ThePhantomUpvoter 20-Apr-13 17:24pm
"how to edit the register form", I am assuming you mean "registration form", open the code in your favorite editor and write the code that you want to change. That is write the code to add a security question, address and mobile number. Be sure to save it when you are done.
Hadi_Hassan 20-Apr-13 17:32pm
how can i add the data from them to the ASPNETDB ??
ThePhantomUpvoter 20-Apr-13 19:39pm
Just like any other database, create a connection (to whatever you think an ASPNETDB is), and write an SQL command to insert the data, then you execute the command. And none of this has anything to do with your question.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you click on the Source, there is this hierarchy: _

<asp:CreateUserWizard runat="server" ID="RegisterUser" ViewStateMode="Disabled" OnCreatedUser="RegisterUser_CreatedUser">
            <asp:PlaceHolder runat="server" ID="wizardStepPlaceholder" />
            <asp:PlaceHolder runat="server" ID="navigationPlaceholder" />
            <asp:CreateUserWizardStep runat="server" ID="RegisterUserWizardStep">
                    <p class="message-info">
                        Passwords are required to be a minimum of <%: Membership.MinRequiredPasswordLength %> characters in length.
                    <p class="validation-summary-errors">
                        <asp:Literal runat="server" ID="ErrorMessage" />
                        <legend>Registration Form</legend>

Scroll to the end of the list and insert there this code:

                                <asp:Label ID="Label1" runat="server" AssociatedControlID="SecurityQuestion">Security Question</asp:Label>

                                 <asp:Label ID="Label4" runat="server" AssociatedControlID="SecurityQuestion">This is an security code:</asp:Label>
                                <asp:Label ID="SecurityAnswer" runat="server" AssociatedControlID="SecurityAnswer">QR45lt0</asp:Label>
                                <asp:TextBox runat="server" ID="tbSecurityQuestion" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbSecurityQuestion"
                                     CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The Security Question field is required." />
                                <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="SecurityAnswer" ControlToValidate="tbSecurityQuestion"
                                     CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The Security answer was wrong." />
                                <asp:Label ID="Label2" runat="server" AssociatedControlID="Address">Address</asp:Label>
                                <asp:TextBox runat="server" ID="tbAddress" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="tbAddress"
                                     CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The Address field is required." />
                                <asp:Label ID="Label3" runat="server" AssociatedControlID="MobileNumber">Mobile Number</asp:Label>
                                <asp:TextBox runat="server" ID="tbMobileNumber" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="tbMobileNumber"
                                     CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The Mobile Number field is required." />

I hope this helped!

If you want it for the database, just use tbMobileNumber.Text and tbAddress.Text as parameters for your OracleCommand or SqlCommand.

Pepin z Hane
Hadi_Hassan 20-Apr-13 17:50pm
what should i put to take the data from the text boxes to save them in the data base? thanks
Pepin z Hane 20-Apr-13 18:07pm
and what about tbMobileNumber.Text? Maybe you have asked a wrong question. How do you connect to the database? What database system do you use? How do you insert the data to the database - do you use some object-relational mapping or simple DbCommand?
Hadi_Hassan 20-Apr-13 18:10pm
i want the tbMobileNumber to be added to another database into a table named customers .... i took the values of the username and email and added them to that database using session do i do the same for those ?
Hadi_Hassan 20-Apr-13 18:14pm
the tbMobileNumber.text isnt working because i put the code in the CreateUserWizardStep is there Another way ... the Id for CreateUserWizard is #RegisterUser
Pepin z Hane 20-Apr-13 18:30pm
I see,there was a small error. The labels have to have instead AssociatedControlID="SecurityQuestion" this AssociatedControlID="tbSecurityQuestion". But it doesn't work still. Now it is written in the same way as the items of <li> before.
Pepin z Hane 20-Apr-13 18:32pm
I don't know, maybe try to write it by your own. You haven't used empty web form application, have you?
Hadi_Hassan 20-Apr-13 18:40pm
no asp,net website
Hadi_Hassan 20-Apr-13 18:42pm
but the registration form u making a server error that's because i haven't entered a security question Text box or a reference to it

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.151126.1 | Last Updated 21 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100