开发者

RequiredFieldValidator keeps refreshing the page

I am creating a register form and when the user clicks on the confirm password field, the page refreshes and I lose the text开发者_如何学C from the other field (the password field)

The code to the confirm password is here below:

<asp:RequiredFieldValidator ValidationGroup="CreateAccount1" 
    CssClass="FieldValidator" EnableClientScript="true"
    ControlToValidate="TxtPass" ID="pPassword" runat="server"
    Text="Password required" ErrorMessage="Password required" />

Thanks, C.


It looks like the AutoPostBack property of your first password field is set to true. In that case, the page will be posted back to the server as soon as that field loses focus, bypassing client validation.

You might want to set that property to false instead.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜