Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
how to edit the register form asp.net 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">
        <LayoutTemplate>
            <asp:PlaceHolder ID="wizardStepPlaceholder" runat="server"></asp:PlaceHolder>
            <asp:PlaceHolder ID="navigationPlaceholder" runat="server"></asp:PlaceHolder>
        </LayoutTemplate>
        <WizardSteps>
            <asp:CreateUserWizardStep ID="RegisterUserWizardStep" runat="server">
                <ContentTemplate>
                    <h1 class="pagetitle">
               Create a New Account
        </h1>
                       <br />
                    <p style="color: #FFFFFF">
                        Use the form below to create a new account.
                    </p>
                    <br />
                    <p style="color: #FFFFFF">
                        Passwords are required to be a minimum of <%= Membership.MinRequiredPasswordLength %> characters in length.
                    </p>
                    <span class="failureNotification">
                        <asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
                    </span>
                    <asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification" 
                         ValidationGroup="RegisterUserValidationGroup"/>
                    <div class="accountInfo">
                        <fieldset class="register">
                            <legend style="color: #FFFFFF">Account Information</legend>
                            <p>
                                <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." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email" 
                                    ForeColor="White">E-mail:</asp:Label>
                                <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." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password" 
                                    ForeColor="White">Password:</asp:Label>
                                <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." 
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:RequiredFieldValidator>
                            </p>
                            <p>
                                <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."
                                     ValidationGroup="RegisterUserValidationGroup">*</asp:CompareValidator>
                            </p>
                        </fieldset>
                        <p class="submitButton">
                            <asp:Button ID="CreateUserButton" runat="server" CommandName="MoveNext" Text="Create User" 
                                 ValidationGroup="RegisterUserValidationGroup" CssClass = "redButton"/>
                        </p>
                    </div>
                </ContentTemplate>
                <CustomNavigationTemplate>
                </CustomNavigationTemplate>
            </asp:CreateUserWizardStep>
<asp:CompleteWizardStep runat="server"></asp:CompleteWizardStep>
        </WizardSteps>
    </asp:CreateUserWizard>
Posted 20-Apr-13 12:10pm
Edited 20-Apr-13 12:56pm
v3
Comments
ThePhantomUpvoter at 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 at 20-Apr-13 17:32pm
   
how can i add the data from them to the ASPNETDB ??
ThePhantomUpvoter at 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
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
Rate this: bad
good
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">
        <LayoutTemplate>
            <asp:PlaceHolder runat="server" ID="wizardStepPlaceholder" />
            <asp:PlaceHolder runat="server" ID="navigationPlaceholder" />
        </LayoutTemplate>
        <WizardSteps>
            <asp:CreateUserWizardStep runat="server" ID="RegisterUserWizardStep">
                <ContentTemplate>
                    <p class="message-info">
                        Passwords are required to be a minimum of <%: Membership.MinRequiredPasswordLength %> characters in length.
                    </p>
 
                    <p class="validation-summary-errors">
                        <asp:Literal runat="server" ID="ErrorMessage" />
                    </p>
 
                    <fieldset>
                        <legend>Registration Form</legend>
                        <ol>
                            <li>
 

Scroll to the end of the list and insert there this code:
 
<li>
                                <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." />
                            </li>
                            <li>
                                <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." />
                            </li>
                            <li>
                                <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." />
                            </li>
 

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
  Permalink  
v3
Comments
Hadi_Hassan at 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 at 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 at 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 at 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 at 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 at 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 at 20-Apr-13 18:40pm
   
no asp,net website
Hadi_Hassan at 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
0 Sergey Alexandrovich Kryukov 275
1 OriginalGriff 230
2 BillWoodruff 173
3 CPallini 155
4 Kamal Rocks 144
0 OriginalGriff 5,655
1 DamithSL 4,506
2 Maciej Los 3,997
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 21 Apr 2013
Copyright © CodeProject, 1999-2014
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