Reputation: 3022
i use mvc3 razor in my form i use this code:
@Html.ValidationMessage(Model.SMF_Name)
it's not working because it render
<span class="field-validation-error" data-valmsg-for="About" data-valmsg-replace="true">
<span htmlfor="About" generated="true" class="">Please fill this field.</span>
</span>
it's put the value instead of the name in the htmlfor attribute.
Upvotes: 0
Views: 625
Reputation: 1038820
Did you try:
@Html.ValidationMessageFor(x => x.SMF_Name)
Upvotes: 1