Top "Data-annotations" questions

Data Annotations are used by frameworks such as ASP.

ASP.NET MVC - Default Range validation error message not being overridden

Say I have a model property like this: [Range(1, 31, ErrorMessage = "O dia de fechamento deve possuir valores entre 1 e 31")] public …

c# asp.net-mvc asp.net-mvc-4 data-annotations rangevalidator
ASP.NET MVC 3 Custom Display Template With UIHint - For Loop Required?

If i have a ViewModel like this: public class MyViewModel { [UIHint("SomeTemplate")] public ICollection<SomeViewModel> Submodel { get; set; } } …

asp.net-mvc asp.net-mvc-3 razor data-annotations display-templates
How to override Entity Framework validation error messages

I have an Entity Framework 4.1 model that supports multiple ASP.NET MVC web applications. I use DataAnnotations to define and …

asp.net-mvc entity-framework-4 viewmodel modelmetadata data-annotations
Using ASP.Net MVC Data Annotation outside of MVC

i was wondering if there is a way to use ASP.Net's Data annotation without the MVC site. My example …

c# asp.net-mvc data-annotations class-library
ASP.Net MVC 3 - Client side unobtrusive validation for Editor Templates

I am new to ASP.Net MVC 3, facing some issues while trying to implementing client side unobtrusive validation for a …

asp.net-mvc-3 data-annotations editortemplates unobtrusive-validation
Default resource for data annotations in ASP.NET MVC

There's a way to set the default resource to the data annotations validations? I don't wanna make something like this: […

.net asp.net-mvc-2 data-annotations asp.net-mvc-2-validation
difference between: [ScaffoldColumn (false)] and [Display (AutoGenerateField = false)]

To render HTML in my edit view, I use the helper @Html.EditorForModel(). My model: [Required(ErrorMessage = "Campo obrigatório")] […

asp.net-mvc-3 razor data-annotations scaffolding mvc-editor-templates
MVC RequiredIf Attribute - IsValid value parameter always null

I am implementing a RequiredIf validation attribute and the value being passed to the IsValid method is always null. RequiredIfAttribute …

asp.net-mvc-4 data-annotations validationattribute