我想hide/show
打开但不能在内部视图中进行button
。condition
@{
ViewBag.Title = "Mapping";
WebGrid grid = null;
if (ViewBag.Mappings != null)
{
grid = new WebGrid(source: ViewBag.Mappings,
defaultSort: "Id",
canPage: true,
canSort: true,
rowsPerPage: 10);
}
}
<h3>@ViewData["Message"]</h3>
@if (grid != null)
{
@grid.GetHtml(
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column("", header: null, format: @<text>@Html.ActionLink("Edit", "Index", new { uid = (Guid)item.id, userAction = "Edit" }, new { @class = "edit" })
@Html.ActionLink("Delete", "Index", new { uid = (Guid)item.id, userAction = "Delete" }, new { @class = "Delete" })</text>),
grid.Column("PricingSecurityID"),
grid.Column("CUSIP"),
grid.Column("Calculation")
)
)
}
if(@ViewBag.Mappings != null)
{
@Html.ActionLink("Update", "Index", new { userAction = "Update" }, new { @class = "Update" })
}
在上面的视图中,如果ViewBag.Mappings != null
我正在填充 webgrid。如果填充了 webgrid,我需要Update
在 webgrid 下显示一个按钮,但是在条件下我哪里出错了?