validation - Prevent MVC4 SelectList from being 'required' -
i have selectlist in razor page user should able select item or not see appropriate.
the selected item value integer property in entity framework database-first table/class , have associated buddy class meta data - there isn't significant meta data value , not required attribute. mention because i've imported system.componentmodel , system.componentmodel.dataannotations , it's possible might have bearing on things.
in razor page have:
@html.dropdownlistfor(x => x.blah, myselectlist, "(select)")
and source code page reveals:
<select data-val="true" data-val-number="the field blah must number." data-val-required="the blah field required." ...>
i didn't ask 'required' it's there: how inhibit it?
crispin
i think "blah" integer... required. need make blah nullable int.