在asp.net登录控制验证问题 [英] validation problem in asp.net login control

查看:136
本文介绍了在asp.net登录控制验证问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的web应用程序asp.net登录控制。
我用下面的code。

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."
         FailureText="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>

当我给了不正确的用户名和密码,点击登录按钮故障文本将出现。然后清除密码字段,然后点击登录按钮都失败文字和passwordrequirederrormessage验证消息将出现。但我只需要密码requirederrormessage会出现。任何人都可以能够给该该溶液中。谢谢

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

推荐答案

您总是可以解决它,并使用单独的天冬氨酸:RequireFieldValidator 的和一个模板天冬氨酸:登录

You could always work around it, and use separate Asp:RequireFieldValidator's and a templated Asp:Login.

这篇关于在asp.net登录控制验证问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆