我不能让这段代码工作。当我提交表单时,它没有显示验证错误消息。
viewModel
[Required]
public SelectList CountryList { get; set; }
public string Country { get; set; }Create.aspx
<%= Html.DropDownListFor(m => m.Country,Model.CountryList, "--Select--")%>
<%: Html.ValidationMessageFor(model => model.Country,"*") %>发布于 2010-12-14 03:51:59
尝尝这个
public SelectList CountryList { get; set; }
[Required]
public string Country { get; set; }https://stackoverflow.com/questions/4431940
复制相似问题