Skip Navigation LinksHome > Products > .NET Toolkit > SSW .NET Toolkit - WinValidator

SSW .NET Toolkit > User Guide

DOT NET Tool kit - Develop Applications More Efficiently with the SSW .NET Toolkit

Client Side Validation using Extended Providers

SSWValidator provides a simple form validation control that solves the rule Do you use Validator controls?

What is an extended provider?

An extended provider is a component that is dropped on your forms and the purpose of the extended provider is to add more properties to your controls. A good example of an extended provider is the ErrorProvider control that comes with Visual Studio.NET. What the ErrorProvider does is to add some properties to an existing control (e.g. a textbox) which allows error messages to be displayed on that textbox.

Textbox
Figure: A textbox with the ErrorProvider attached to it

SSW WinValidator is an extended provider. When dropped on the form from the toolbox, it attaches additional properties to textboxes to provide field validation.

How to use the SSW Validator

Custom Controls

Another way to achieve a similar result is by creating custom controls. This can be done by creating a new control which inherits the base control and then adding the properties required for validation to the new control.

Public Class mySelfValidatingTextbox
Inherits System.Windows.Forms.TextBox

'// Implementation code goes here

End Class
Figure: Sample Self Validating Textbox

Custom controls are good because they:

Although custom controls have some benefits, they are vulnerable to certain pitfalls that extended providers are not. For instance, on a form that has several textboxes, in order to use a customised textbox, substantial code modification would be required. It would be necessary to:

This tedious procedure makes it clear as to why Extended Providers are the better choice for adding properties to controls.