RequiredFieldValidator doesn't work when submitting form after Posting back by TextChanged event to the Textbox
问题 In my .aspx form I have a text box with Autopostback=True . I also set a RequiredFieldValidator next to it. But when Posting back by TextChanged event of my text box, my RequiredFieldValidator appears but still I can submit my form with nothing in the text box! What is wrong, and how can I fix this? 回答1: You have to set the textbox's CausesValidation property to true (it's set to false by default for textboxes). 回答2: Give both the text box and the submit button the same validation group. 回答3: