|
ASP.NET Validation Package Demo 5 - Customised validation summaryThe following demo is identical to demo 2 except that the validation summary has been customised. Like demo 2, the dummy form is designed to collect basic user information from a subscriber. The form contains a series of validation rules as follows:
The client-side code in this example has been explicitly disabled so that the form is allowed to send errors back to the server. If client-side code were enabled, it would block all errors as the submit button was pressed, forcing only valid entries to be sent to the server and consequently the validation summary would not show. As you will see from viewing the code for this demo, the demo validation summary is called "Validator." This is because it is extending the Validator control itself (i.e. MadWidgets.Validation.Validator). While it is not required to do this, it makes sense to do so as it reduces code. If the validation summary didn't extend the Validator control, it would need to reference the instance of the Validator rather than just calling its inherited members. In addition, the Validator control would have to be placed on the page somewhere anyway as a custom control. >> Show me the code for the demo validation summary! >> Show me the code for the normal validation summary shipped with the product! © 2002 - 2008 Copyright, Disclaimer and Privacy Statement |
||||||