Validating integer with regularexpressionvalidator
That example was only intended to illustrate how quickly a control can be created through the use of inheritance, so it was quite limited.
In this case I don't want to use a User Control, since I am inheriting from an existing control, so I am going to delete that file and just add a new class file.
Sample 1b: Adding Regular Expression Validation an Alternative Way Summary Two samples are covered in this article: creating a custom Text Box that performs regular expression validation, and creating an extender provider that uses a different method to perform the same regular expression validation.
In the overview article, I showed you how to quickly enhance the Text Box control to accept only numeric data, creating a new control with a minimum amount of work on your part.
With just that little bit of code I have already created my own version of the Text Box by inheriting from the existing control.
Since I haven't added any of my own code, this new control would look and behave exactly like a regular Text Box; inheriting does not change anything until you start adding code or attributes.