Asp.net mvc 3: Strange Validation
- by coure06
I have applied DataAnnotation based validations to two of my properties like this
[Required(ErrorMessage = "Title is required")]
public string Title { get; set; }
[Required(ErrorMessage = "Description is required")]
public string Description { get; set; }
Here is the view page's code
@Html.LabelFor(model => model.Obj.Title)
@Html.EditorFor(model => model.Obj.Title)
@Html.LabelFor(model => model.Obj.Description)
@Html.TextAreaFor(model => model.Obj.Description)
The Problem is that on click of submit button, on client side (js) its only giving me error for for Title and not for the Description. But Its giving me validation error for the Description after the postback.
What possible causes?