我的视图模型:
public class SendFileDeviceViewModel
{
public string DeviceName { get; set; }
public int DeviceId { get; set; }
public string ManagementGroupName { get; set; }
public int ManagementGroupId { get; set; }
}
public class SendFileManagementGroupViewModel
{
public string ThisManagementGroupName { get; set; }
public List<SendFileDeviceViewModel> DeviceList { get; set; }
}
我的观点:
@model Ceridian.Wfm.DeviceManager.Models.Terminals.SendFileManagementGroupViewModel
@{
ViewBag.Title = "Index";
Layout = "~/Areas/Terminals/Views/Shared/Master/_TerminalLayout.cshtml";
}
@section termimalContent {
@using (Html.BeginForm())
{
@Html.ValidationSummary(true)
foreach (var dev in Model.DeviceList)
{
<fieldset>
<legend>@dev.DeviceName - [ @dev.ManagementGroupName ]</legend>
@Html.CheckBoxFor(m => m.
</fieldset>
}
}
}
lambda 返回我的整个模型,而不是dev
. 任何人都可以帮忙吗