我不知道value
参数来自哪里。
查看:Ajax.BeginForm
询价:
@Html.DropDownListFor(model => model.EXPENSE_REPORTABLE, new SelectList(
new[]
{
new { Value = "true", Text = "Yes" },
new { Value = "false", Text = "No" },
},
"Value",
"Text",
Model
),
"-- Select --")
在下拉列表中选择是或否后,将呈现部分视图以在 WebGrid 中显示数据(grid
是 的实例WebGrid
)。其中一列引发错误:
grid.Column("expenseReportable","Expense Reportable?",format:@<text>
<span class="display-mode">@item.EXPENSE_REPORTABLE </span> <!--error here -->
@Html.RadioButton("GridCol_Expense", (Nullable<bool>)item.EXPENSE_REPORTABLE, true, new { @class="edit-mode"}) Yes
@Html.RadioButton("GridCol_Expense", (Nullable<bool>)item.EXPENSE_REPORTABLE, false, new { @class="edit-mode"}) No
</text>, style:"col1Width"),
模型属性:
public Nullable <bool> EXPENSE_REPORTABLE {get; set;}
内部异常:null
异常消息:
值不能为空。参数名称:值