WEBSWAPP Silverlight ASP.NET 3.5 ASP.NET 2.0 ASP.NET 1.0
Cascading Lists
ITemplate
DDL in GridView
G/V MultiSelect
Nested GridViews
RegExp
DataGrid Reorder
Events fire twice
Hyperlink Field
TextBox
UpdateParameters
MultiView
TreeView
C# Demo VB Demo

Client-side validation of the TextBox server control

If I had to change the HTML objects on the browser based on validating the textboxes input I would not use the Validation server controls. I would validate using regular expressions and JavaScript on the client.

Below you should see 2 examples of validation; one that simulates the masked text box for entering date. It would not allow you to type a character that does not match the date format specified. The other would verify the number to be of 2 decimals.

To see the source code click on the link at the bottom of this section. For a more advanced demo on using regular expressions click on the demo on the side menu titled "Regular Expressions".

Please enter a date in the following format only MM/DD/YYYY:
Please enter a number with 2 decimals only

Source code:

C# Demo source code