NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Testing Validity Programmatically

Validation controls test user input, set an error state, and produce error messages. They do not change the flow of page processing — for example, they do not bypass your code if they detect a user input error. Instead, you test the state of the controls in your code before performing application-specific logic. If you detect an error, you prevent your own code from running; the page continues to process and is returned to the user with error messages.

You can test for a general, page-wide state, and you can test the state of individual controls. Typically, you do this in the event handlers that you create for a page.

Note   Validation information is not available during a page's initialization or load stage. For details about page states, see Writing a Custom Web Forms Control.

To test for a general error state

To test for the error state of individual controls

See Also

Validation Controls | Introduction to Validating User Input in Web Forms |