dropdownlistfor

    0热度

    1回答

    从我的MVC3应用程序中获取一些非常恼人的行为。所以我有一个模型3个值: [DisplayName("Airlines ")] [StringLength(2, ErrorMessage = "Airline codes can only be 2 characters in length")] public string AirlineCode1 { get; set; } [Displ

    2热度

    2回答

    我有一个下拉列表(@ html.DropDownListFor),其中我显示颜色的名称...我想显示每个项目具有单独的背景颜色..喜欢,一个项目“绿色”应该在绿色背景,并且“黄色“在黄色背景中。 我该如何做到这一点?

    -2热度

    1回答

    我暂一个下拉列表如下: @Html.DropDownListFor(model => model.Department.Id, new SelectList(db.PhoenixIKDepartments.ToList(), "Id", "Name")) 我希望有编号,编号及名称,但只有Id和的ModelState是假的。 public class Phoenix_IK_Persons {

    2热度

    1回答

    我在输入表单中有其他字段和下拉列表。他们都证实罚款。即使是没有正确验证前端的两个元素,仍然可以在帖子中正确模拟绑定。我不完全确定他们为什么不验证。下面是设置: 视图模型 public class DataVM { //Widgets used, populated from database public List<Widget> Widgets { get; set; } //Cont