Validation on DropDownList Does not work with DataAnnotations
If I have a dropdown as follows
<div class="editor-label"> <%= Html.DropDownListFor(model => model.CardDetail.SelectedCardSchemeId, Model.CardDetail.CardSchemes, "Select")%> </div>
and in my model I use DataAnnotations
[Required(ErrorMessage = "* Required SelectedCardSchemeId Message")] public int SelectedCardSchemeId { get; set; }
How can I get a message in a view? In debugging, I see that the ModelState error fills up, but the message does not appear in the view. I have no problem displaying an error message for other controls (TextBoxFor)
+1