我正在使用asp.net剃须刀(旧版本,代码使用lambda表达式)进行编码,并且无法根据T / F的单选按钮选择来确定如何绑定文本框中的文本
在ViewModel中:
public List<string> IdEnabled { get; set; }
public List<string> IdDisabled { get; set; }
@Html.TextBoxFor("{something here? don't know}", "", new { @class = "small-textbox", @id = "FeatId"})
@Html.RadioButtonFor(model => model.IdEnable, true, new { @id = "Enable-Disable"})
@Html.Label("", "Enable", new { @class = "radiobutton-text", @for = "Enable-Disable" })
@Html.RadioButtonFor(model => model.IdDisable, false, new { @id = "Enable-Disable"})
@Html.Label("", "Disable", new { @class = "radiobutton-text", @for = "Enable-Disable" })
-然后是一个按钮,用于在最终提交之前添加信息并向用户显示