开发者

ASP.NET Ajax and Validator problem

I have a webform with a TextBox, SaveButton, RequiredFieldValidator, DataGrid and a paging button. They'r开发者_开发知识库e all in a single UpdatePanel. SaveButton saves TextBox value to the database and refreshes the DataGrid. Paging button retrieves next n records and refreshes the DataGrid. The problem is, when I click paging button to refresh the DataGrid, RequiredFieldValidator fires. How can I make it fire only when I click SaveButton?

I have set EnableClientScript="true" and ControlToValidate="textBox1" for the validator.


Restrict the textbox validator and the save button to a Validation Group.


Solved it by setting CausesValidation=false of the paging button.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜