从我的MVC3应用程序中获取一些非常恼人的行为。所以我有一个模型3个值: [DisplayName("Airlines ")]
[StringLength(2, ErrorMessage = "Airline codes can only be 2 characters in length")]
public string AirlineCode1 { get; set; }
[Displ
我暂一个下拉列表如下: @Html.DropDownListFor(model => model.Department.Id, new SelectList(db.PhoenixIKDepartments.ToList(), "Id", "Name"))
我希望有编号,编号及名称,但只有Id和的ModelState是假的。 public class Phoenix_IK_Persons
{
我在输入表单中有其他字段和下拉列表。他们都证实罚款。即使是没有正确验证前端的两个元素,仍然可以在帖子中正确模拟绑定。我不完全确定他们为什么不验证。下面是设置: 视图模型 public class DataVM
{
//Widgets used, populated from database
public List<Widget> Widgets { get; set; }
//Cont