Email: Password:       Forgot Password 
A Saarsha Group Online Community for dot net codes group like C#, Asp.NET, VB.NET, Sharepoint, JavaScript, JQuery, Ajax, SQL, WCF, WPF.
What are the different Data Annotation attributes ?

Posted On: 22/02/2014 10:19:49
Required - This attribute makes the property of model mandatory for user.
StringLength - The StringLength attribute specifies the maximum length of string that is acceptable.

RegularExpression - Regular expressions are an efficient and terse means to enforce the shape and contents of a string value.

Range - The Range attribute specified the minimum and maximum constraints for a numerical value.

Compare - The compare attribute ensures two properties on a model object have the same value.

Display - The Display attribute sets the friendly name for a model property.

ScaffoldColumn - The scaffoldColumn attribute hides a property from HTML helper such as EditorForModel and DisplayForModel.

MaxLength - MaxLength Attribute ensures the length of the string entered is according to the specified value.

DataType - The DataType attribute enables you to provide the run time with information about the specific purpose of a property.

UIHint - The UIHint attribute as the name itself suggest gives the MVC run time the name of a template to use when rendering output with the templated helpers like (DisplayFor and EditorFor).

HiddenInput - The property that has HiddenInput defined on it will be rendered as input type hidden on form.
         HOME   |   Submit Article   |   Contact Us   |   About Us   |   Terms & Condition   |   Advertise With us