Validating checkboxes in asp net
Now we have the validation working on the server after a postback, but it would be nice if we could perform the validation directly on the client when the user toggles the state of the checkboxes.To accomplish this there is another step to take: inject some client side Java Script in the On Pre Render method.At this point, we have all of the needed server-side functionality for the Check Box Validator control.To add client-side functionality, however, we must add a bit more code. NET provides a variety of validation Web controls that can be used to validate a user's form field inputs. NET 2.0 for the validation control changes from ASP. NET version 2.0.) Unfortunately, the validation Web controls do not work with the Check Box or Check Box List Web controls. for general information on the validation Web controls and Dissecting Validation Controls in ASP.The Pre Render event is raised just before the control is rendered on the page, so it the best moment to inject some client side functionality into the page.
What constitutes validity depends on the validation control - a Required Field Validator, for example, checks to ensure that its control's current value doesn't equal the specified property indicates the least number of Check Box List items that must be selected for validity.
property to determine whether validation is performed on both the client and the server when a Check Box control is selected.