开发者

validation in asp.net login control [duplicate]

This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

validation problem in asp.net login control

I have asp.net login control in my web application. 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 g开发者_如何学Cive the solution for that. Thank you


If you are checking the username/password in a Click event, make sure to check the page's IsValid property before continuing. If username/password are being validated through a validation control, set its EnableClientScript to false and the RequiredFieldValidator to true. This will prevent the form from submitting without a password and the second validator from being called, unless they have JavaScript turned off.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜