【发布时间】:2023-03-15 19:50:01
【问题描述】:
我的表单中有复选框
我在我的模型上添加了
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace CorePartners_Site2.Models
{
public class CareerForm
{
//....
public List<CheckBoxes> EmploymentType { get; set; }
}
}
public class CheckBoxes
{
public string Text { get; set; }
public bool Checked { get; set; }
}
并添加到我的表单中
@Html.CheckBoxFor(model => model.EmploymentType, new { id = "employmentType_1" })
@Html.CheckBoxFor(model => model.EmploymentType, new { id = "employmentType_2" })
@Html.CheckBoxFor(model => model.EmploymentType, new { id = "employmentType_3" })
但我弄错了
怎么了?
【问题讨论】:
标签: c# .net asp.net-mvc asp.net-mvc-4 razor