Click here to Skip to main content
13,043,654 members (51,849 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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>
            <asp:PlaceHolder ID="navigationPlaceholder" runat="server"></asp:PlaceHolder>
            <asp:CreateUserWizardStep ID="RegisterUserWizardStep" runat="server">
                    <h1 class="pagetitle">
               Create a New Account
                       <br />
                    <p style="color: #FFFFFF">
                        Use the form below to create a new account.
                    <br />
                    <p style="color: #FFFFFF">
                        Passwords are required to be a minimum of <%= Membership.MinRequiredPasswordLength %> characters in length.
                    <span class="failureNotification">
                        <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
                    <asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification" 
                    <div class="accountInfo">
                        <fieldset class="register">
                            <legend style="color: #FFFFFF">Account Information</legend>
                                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName" 
                                    ForeColor="White">User Name:</asp:Label>
                                <asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" 
                                     CssClass="failureNotification" ErrorMessage="User Name is required." ToolTip="User Name is required." 
                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email" 
                                <asp:TextBox ID="Email" runat="server" CssClass="textEntry"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email" 
                                     CssClass="failureNotification" ErrorMessage="E-mail is required." ToolTip="E-mail is required." 
                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" 
                                <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" 
                                     CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required." 
                                <asp:Label ID="ConfirmPasswordLabel" runat="server" 
                                    AssociatedControlID="ConfirmPassword" ForeColor="White">Confirm Password:</asp:Label>
                                <asp:TextBox ID="ConfirmPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ControlToValidate="ConfirmPassword" CssClass="failureNotification" Display="Dynamic" 
                                     ErrorMessage="Confirm Password is required." ID="ConfirmPasswordRequired" runat="server" 
                                     ToolTip="Confirm Password is required." ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                                <asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password" ControlToValidate="ConfirmPassword" 
                                     CssClass="failureNotification" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
                        <p class="submitButton">
                            <asp:Button ID="CreateUserButton" runat="server" CommandName="MoveNext" Text="Create User" 
                                 ValidationGroup="RegisterUserValidationGroup" CssClass = "redButton"/>
<asp:CompleteWizardStep runat="server"></asp:CompleteWizardStep>
Posted 20-Apr-13 11:10am
Updated 20-Apr-13 11:56am
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
Web01 | 2.8.170713.1 | Last Updated 21 Apr 2013
Copyright © CodeProject, 1999-2017
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