开发者

Validators do not Validate after postback occurs

开发者 https://www.devze.com 2023-02-27 07:10 出处:网络
I found the source of the issue i did not explain it very well. Basically i have a form with a compare validator that makes sure my txtstartdate is not less than my txtenddate. So these 2 text boxes

I found the source of the issue i did not explain it very well.

Basically i have a form with a compare validator that makes sure my txtstartdate is not less than my txtenddate. So these 2 text boxes have ajax calendar attached to it and when I select those 2 my compare validator appears and gives an error.

Then i have 2 dropdownlist ddlroom, ddlnumber. ddlroom has autopostback enabled so if i populate my calendar incorrectly having my endate before startdate the comparevalidator fires however the second i select a roomname the autopostback occurs and the v开发者_运维百科alidator dissapears and I am able to click the insert button and it will insert what ever date is in the textboxes without validating. Hope that explains a little better sorry


If you want validation to fire when your DropDownList does a postback then be sure to set CausesValidation="true" on the DropDownList.

0

精彩评论

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