validation problem in asp.net login control
I have asp.net login control in my web application. I used the following code.
<asp:Login ID="LoginControl" runat="server" Width="351px" CssClass="login"
PasswordRequiredErrorMessage="You must enter a Password."
UserNameRequiredErrorMessage="You must enter a Username."
F开发者_JS百科ailureText="Incorrect Username/Password"
EnableTheming="true" TitleText="Login into Focus/Career Status Viewer"
Height="164px" onauthenticate="LoginControl_Authenticate"
DisplayRememberMe="False"
UserNameLabelText="Username:" Font-Names="Arial" FailureTextStyle-Wrap="False" FailureAction="RedirectToLoginPage">
<TextBoxStyle CssClass="login-textbox" Font-Names="Arial" />
<LoginButtonStyle CssClass="login-button" />
<ValidatorTextStyle Font-Names="Calibri" />
<TitleTextStyle CssClass="login-title"/>
</asp:Login>
<br />
<br />
<asp:ValidationSummary id="LoginValidationSummary"
runat="server" ShowSummary="true"
ValidationGroup="LoginControl" Height="44px" Width="471px" >
</asp:ValidationSummary>
When I give the incorrect username and password and click the login button the failure text will appeared. Then clear the password field then click the login button both failure text and passwordrequirederrormessage validation messages will appeared. But I need only the password requirederrormessage will appeared. Can anyone able to give the solution for that. Thank you
You could always work around it, and use separate Asp:RequireFieldValidator
's and a templated Asp:Login
.
精彩评论