The masking language that is used by Masked Text Box is very flexible.
It allows you to specify required characters, optional characters, literal characters, such as hyphens and parentheses, currency characters, and date separators.
In this case, to perform validation in the Validated event, change the control's Data Source Update Mode property (under (Databindings)\(Advanced)) from On Validation to Never, and add So when does a control's data get validated? You can use either implicit or explicit validation, depending on the needs of your application.The implicit validation approach validates data as the user enters it.You can validate the data in response to a user action, such as clicking a Save button or a Next link.When the user action occurs, you can trigger explicit validation in one of the following ways: However, in some cases, you might want to let the user close the form regardless of whether the values in the controls are valid.If you want to use implicit validation for a control, you must set that control's Auto Validate property to .
If you cancel the Validating event, the behavior of the control will be determined by what value that you assigned to Auto Validate.When you use data binding, the data in your control is synchronized with the data source during execution of the Validating event.If you cancel the Validating event, the data will not be synchronized with the data source.This validator checks the markup validity of Web documents in HTML, XHTML, SMIL, Math ML, etc.If you wish to validate specific content such as RSS/Atom feeds or CSS stylesheets, Mobile OK content, or to find broken links, there are other validators and tools available.As an alternative you can also try our non-DTD-based validator.