0
我有這兩個下拉列表,都應該是年齡和我想要讓這個你不能做比最大年齡2下拉列表mvc4創建自定義的驗證
<div class="col-lg-3 col-md-3 col-sm-3 editor-group ">
@Html.Label("Mininum Age")
@Html.DropDownListFor(model => model.Preference.MinAgeId, new SelectList(Model.MinAges, "AgeId", "CurAge", Model.Preference.MinAgeId),"-Any-", new { @class = " form-control" })
@Html.ValidationMessageFor(model => model.MinAges)
</div>
<div class="col-lg-3 col-md-3 col-sm-3 editor-group ">
@Html.Label("Maximum Age")
@Html.DropDownListFor(model => model.Preference.MaxAgeId, new SelectList(Model.MaxAges, "AgeId", "CurAge", Model.Preference.MaxAgeId),"-Any-", new { @class = " form-control" })
@Html.ValidationMessageFor(model => model.MaxAges)
</div>
我不知道,較高的最低年齡如果我創建下拉列表的方式可以使用此nuget包MVC Foolproof Validation來標記它在其他所有下拉列表之間是否無效
正是我需要感謝 – imGreg