I have a wrapper User Control control around a Drop Down List for managing language specific translation on the Drop Down List values. I also have a required field validator that is requried for the inner dropdownlist.
Check Control Validation Property(String name, String property Name) at System.
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.
Take advantage of the Data Annotation Model Binder to perform validation within an ASP. Learn how to use the different types of validator attributes and work with them in the Microsoft Entity Framework. Finally, the Unit Price property must match a regular expression pattern that represents a currency amount.
In this tutorial, you learn how to use the Data Annotation validators to perform validation in an ASP. The advantage of using the Data Annotation validators is that they enable you to perform validation simply by adding one or more attributes – such as the Required or String Length attribute – to a class property. Listing 1: Models\The Product class illustrates how to use one additional attribute: the Display Name attribute.
Before you can use the Data Annotation validators, you must download the Data Annotations Model Binder. Next click the Browse tab and browse to the location where you downloaded (and unzipped) the Data Annotations Model Binder sample (see Figure 1). The Display Name attribute enables you to modify the name of the property when the property is displayed in an error message.
You can download the Data Annotations Model Binder Sample from the Code Plex website by clicking here. Figure 1: Adding a reference to the Data Annotations Model Binder (Click to view full-size image) Select both the Microsoft. Instead of displaying the error message "The Unit Price field is required" you can display the error message "The Price field is required".
It is important to understand that the Data Annotations Model Binder is not an official part of the Microsoft ASP. Although the Data Annotations Model Binder was created by the Microsoft ASP. Listing 2: Controllers\Product Finally, you can create the view in Listing 3 by right-clicking the Create() action and selecting the menu option Add View.
NET MVC team, Microsoft does not offer official product support for the Data Annotations Model Binder described and used in this tutorial. Create a strongly-typed view with the Product class as the model class.