Validators do not Validate after postback occurs
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.
精彩评论