Set the Xml Reader Settings object's Validation Type property to the value Validation Type.
When you declare it in markup it adds client side code that validates this control on the client side and will cancel the postback if it is not valid.
A , DCSE, e-Biz , i-Net , MCDST, MCP, Network , Security , A. NET Calendar Control | Useful Win Form Controls | Regular Expression (Regex) Library | Backup/Restore SQL Server 2005 Database using code | Verify SQL Server 2005 database backup using SMO | Backup SQL Server 2005 database using SMO | Restore SQL Server 2005 database using SMO | Use Fx Cop from Microsoft to aid with code optimization The Masked Text Box is not a panacea because it requires a fixed length mask. Just use a Numberic Up Down with the Decimal Places property set to 2 or a regular Text Box and validate it for currency: Why is my data not saved to my database? NET using Visual Basic 2010 Express.) If the user manually entered a "$" into the textbox there an unhandled exception would result.
| MSDN Data Walkthroughs VBForums Database Development FAQ My Code Bank Submissions: VB | C# My Blog: Data Among Multiple Forms (3 parts) Beginner Tutorials: VB | C# | SQL I found the above code by jmcilhinney to be very helpful. I eventually fixed this by adding one line of code into the Sub Textbox1_Validating(...).
All we have to do to fire up validators is to call “Page_Client Validate()” function.
The following Java Script code shows how “Page_Client Validate()” function can be used before closeing window.
Failure to register a method with Validation Event Handler causes an exception (Xml Exception) to be thrown when the XML document is found to be invalid or missing.