I have model property:
public int? RegionId { get; set; }
I create dropdownlist in view:
@Html.DropDownListFor(m => m.RegionId, Model.Regions)
In html:
<select data-val="true" data-val-number="The field RegionId must be a number."
</select>
I need to remove the attribute data-val-number, because in a particular case it not right for me.
I try in Application_Start:
DataAnnotationsModelValidatorProvider.AddImplicitRequiredAttributeForValueTypes = false;
Also note RegionId is nullable.
How I can remove this attribute on server-side code? (not javascript)