自定义CreateUserWizard控件 [英] Customizing the CreateUserWizard Control
本文介绍了自定义CreateUserWizard控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友,
我正在尝试使用CreateUserWizard控件.我遇到一个错误,说
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.
我尝试了google,但仍然没有解决办法.
有人知道出什么问题了吗?
这是我的示例代码
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>
推荐答案
它显然表明没有ID为UserName
的控件.
您已将该文本框命名为txtLoginName
以下链接可以帮助您自定义向导.
http://msdn.microsoft.com/en-us/library/ms178342.aspx [ ^ ]
http://stackoverflow.com/questions/2361363/remove-或-disable-security-question-and-answer-from-createuser向导 [ http://forums.asp.net/p/1023140/1388290.aspx [ ^ ]
^ ]
It clearly says that there is no control with idUserName
.
You have named that textbox astxtLoginName
Following link may help you in customizing the wizard.
http://msdn.microsoft.com/en-us/library/ms178342.aspx[^]
http://stackoverflow.com/questions/2361363/remove-or-disable-security-question-and-answer-from-createuserwizard[^]
http://forums.asp.net/p/1023140/1388290.aspx[^]
Google[^]
这篇关于自定义CreateUserWizard控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文