asp.net - asp:CreateUserWizard - how to display minimum password requirement -
it's not displaying min requirement until 'createuser' clicked. how make validate password requirement beforehand , display message when password field loses focus.
with default markup of createuserwizard control below, cannot have such functionality.
<asp:createuserwizard id="createuserwizard1" runat="server"> <wizardsteps> <asp:createuserwizardstep id="createuserwizardstep1" runat="server"> </asp:createuserwizardstep> <asp:completewizardstep id="completewizardstep1" runat="server"> </asp:completewizardstep> </wizardsteps> </asp:createuserwizard>
therefore, idea customize createuserwizard
control per needs. better use validators can display messages beforehand. key create <contenttemplate>
element within <asp:createuserwizardstep>
element.
<asp:createuserwizardstep id="createuserwizardstep1" runat="server"> <contenttemplate> <table> <tr> <td> sign started</td> </tr> <tr> <td align="right"> <asp:label id="usernamelabel" runat="server" associatedcontrolid="username"> user name:</asp:label></td> <td> <asp:textbox id="username" runat="server"></asp:textbox> <asp:requiredfieldvalidator id="usernamerequired" runat="server" controltovalidate="username" errormessage="user name required." tooltip="user name required." validationgroup="createuserwizard1">*</asp:requiredfieldvalidator> </td> <tr> <td> <asp:label id="passwordlabel" runat="server" associatedcontrolid="password"> password:</asp:label></td> <td> <asp:textbox id="password" runat="server" textmode="password"></asp:textbox> <asp:requiredfieldvalidator id="passwordrequired" runat="server" controltovalidate="password" errormessage="password required." tooltip="password required." validationgroup="createuserwizard1">*</asp:requiredfieldvalidator> </td> </tr> </contenttemplate> </asp:createuserwizardstep>
read msdn complete tutorial.
Comments
Post a Comment