Question:You created a Web page that contains many controls that are validated using validation
controls. This page also contains Button controls that perform PostBacks. You
disabled all of the client-side validation and noticed that when you clicked any of the
Button controls, the code in the Click event handler was executing even when some of
the controls did not have valid data. How can you best solve this problem to ensure
code is not executed when invalid data exists?
A In the Click event handler method for each of your Button controls, test the Web
page’s IsValid property and exit the method if this property is false.
B In the Load event handler method of the Web page, test the Web page’s IsValid
property and exit the method if this property is false.
C Re-enable the client-side script to disable PostBack until valid data exists.
D Add the runat=”server” attribute to all of the validation controls.