Supporting Data Entry, Page Submission, and Grid controls
Validators interact with other controls on your page. There are three classes of
- Data entry - Validators must be able to retrieve data from your data entry fields,
like textboxes and listboxes.
- Page submission - When a button is clicked, the entire page is validated. Client-side
validation requires that the button can run some code and stop submitting the page
when errors are detected.
- Grid - Grids offer validators some challenges including how their submit controls
Peter's Professional Validation has the most extensive support for controls available,
including third party controls.
Microsoft's 5 validator controls support only their TextBox, ListBox, DropDownList,
HtmlInputTextBox, HtmlTextArea, HtmlSelect, and HtmlInputFile controls. They support
custom controls that implement the ValidationPropertyAttribute
. One thing all these controls
have in common is that their value is textual. That's why you don't see support
for CheckBoxes and RadioButtonLists.
DES supports all of those controls. In addition, DES's existing validators support:
- These Microsoft controls: CheckBox, RadioButton, CheckBoxList, RadioButtonList,
HtmlInputCheckBox, and HtmlInputRadioButton.
- All custom controls subclassed from the Microsoft controls listed above.
- All custom controls that implement the ValidationPropertyAttribute.
- The following HTML data entry tags when they have runat=server and ID= attributes
<input type=text>, <textarea>, <input type=file>, <select>,
<input type=checkbox>, and <input type=radio>
- DES provides an easy way to describe third party custom controls that represent
textboxes, listboxes and the rest but are not subclassed from the original Microsoft
classes. You simply add a line into DES's XML configuration file to identify the
class and properties that contain data.
For example, this describes the MetaBuilders GlobalRadioButton control:
<ThirdPartyControl class="MetaBuilders.WebControls.GlobalRadioButton" sameas="radiobutton"
- Custom control developers can go much further, providing the hooks to interface
with any kind of control.
For example, the
Peter's Date Package CS_Calendar control is a data entry control but it's
built upon a <table>, not a standard input field. Yet, DES supports the CS_Calendar
control. Even better, these extensions are automatically applied to the existing
DES validators. So you use the CompareToValueValidator, CompareTwoFieldsValidator,
and RangeValidator to validate CS_Calendar.
Third Party Data Entry Controls with included support
DES includes guides and support files to support all of these products.
Submitting the Page
When you submit a page, the validators on the page should be validated. There are
two sides to submitting a page: client and server. Microsoft built in support to
automatically validate both sides into these submit controls: Button, LinkButton,
ImageButton, HtmlInputButton, HtmlButton, and HtmlInputImage. For menus and toolbars,
you are on your own.
DES provides support for the standard Microsoft buttons, menus and toolbars. While
the system can be hooked up to any third party button, menu or toolbar, here are
the controls that have been tested and documented in the User's Guide.
There are several tricks to supporting Grid controls.
- The submit buttons need to respect client-side validation, including validation
groups, and the ability to disable validation. DES supplies extensions to the button
column controls for various grid products.
- Individual rows of the grid must support different validation groups. DES makes
this easy. You insert the "+" character at the beginning of a validation group name
and it makes the row have a unique name.
DES includes enhancements for the following grid products: