Click here to Skip to main content
16,017,151 members
Please Sign up or sign in to vote.
2.75/5 (4 votes)
See more:
Hello Friends,
I was trying to work on CreateUserWizard Control. I faced an error saying
CreateUserWizard1: CreateUserWizardStep.ContentTemplate does not contain an IEditableTextControl with ID UserName for the username.


I tried google, still no solution for it.
Anyone have idea whats going wrong?

here my sample code

<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" ContinueDestinationPageUrl="~/Pages/Login/frmLogin.aspx">
        <wizardsteps>
            <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                <contenttemplate>
                    <table>
                        <tr>
                            <td>
                                <asp:Label ID="lblFirstName" runat="server" Text="First Name:"></td>
                                <td><asp:TextBox ID="txtFirstName" runat="server"></td>
                                <td><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                    ErrorMessage="First Name Required" ControlToValidate="txtFirstName" ValidationGroup="CreateUserWizard1">*
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblLastName" runat="server" Text="Last Name:"></td>
                                <td><asp:TextBox ID="txtLastName" runat="server"></td>
                                <td><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                    ErrorMessage="Last Name Required" ControlToValidate="txtLastName"  ValidationGroup="CreateUserWizard1">*
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblLoginName" runat="server" Text="Login Name:"></td>
                                <td><asp:TextBox ID="txtLoginName" runat="server"></td>
                                <td><asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                    ErrorMessage="Login Name Required" ControlToValidate="txtLoginName"  ValidationGroup="CreateUserWizard1">*
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblPassword" runat="server" Text="Password:"></td>
                                <td><asp:TextBox ID="txtPassword" runat="server"></td>
                                <td><asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                    ErrorMessage="Password Required" ControlToValidate="txtPassword"  ValidationGroup="CreateUserWizard1">*
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblConfirmPassowrd" runat="server" Text=" Confirm Password:"></td>
                                <td><asp:TextBox ID="txtConfirmPassowrd" runat="server"></td>
                                <td><asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                    ErrorMessage="Confirm Password Required" ControlToValidate="txtConfirmPassowrd"  ValidationGroup="CreateUserWizard1">*<br />
                                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                    ErrorMessage="Password Not Matching!" ControlToCompare="txtPassword"  ValidationGroup="CreateUserWizard1"
                                    ControlToValidate="txtConfirmPassowrd">*    
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblContact" runat="server" Text="Contact No.:"></td>
                                <td><asp:TextBox ID="txtContact" runat="server"></td>
                                <td><asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                                    ErrorMessage="Contact No. Required" ControlToValidate="txtContact"  ValidationGroup="CreateUserWizard1">*
                            </td>
                        </tr>
                    </table>
                </contenttemplate>
            
            <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
            <contenttemplate>
                <table>
                    <tr>
                        <td colspan="2"><asp:Label ID="lblMessage" runat="server" Text="Login Successfull"></td>
                    </tr>              
                    <tr>
                        <td>
                            <asp:Label ID="lblUserName" runat="server" Text="UserName"></td>
                          <td>  <asp:Label ID="lblPassword" runat="server" Text="">
                        </td>
                    </tr>  
                    <tr>
                        <td>
                            <asp:Button ID="btnComplete" runat="server" Text="Finish" />
                        </td>
                    </tr>
                </table>
            </contenttemplate>
                
            
        </wizardsteps>
Posted
Comments
dhage.prashant01 28-Mar-11 9:10am    
i don't want email, security question. How can i avoid it?

1 solution

It clearly says that there is no control with id UserName.
You have named that textbox as txtLoginName
Following link may help you in customizing the wizard.
http://msdn.microsoft.com/en-us/library/ms178342.aspx[^]

[Edit]
http://stackoverflow.com/questions/2361363/remove-or-disable-security-question-and-answer-from-createuserwizard[^]
http://forums.asp.net/p/1023140/1388290.aspx[^]

Google[^]
 
Share this answer
 
v2
Comments
dhage.prashant01 30-Mar-11 1:11am    
Yes i got what u want to say, but what if i don't want contents like email, security question.
Prerak Patel 30-Mar-11 1:26am    
I've updated the answer. Check new links.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900