我正面临这个问题,我想在一个视图中显示两个 Webgrid,所以我为每个视图创建单独的视图,并使用调用一个视图
<table>
<tr>
<td>
@{Html.RenderAction("NewRegisterCustomer", "AdminDeshboard");}
@{Html.Action("NewRegisterCustomer", "AdminDeshboard");}
</td>
</tr>
<tr>
<td>
@{Html.RenderAction("OrderSummary", "AdminDeshboard");}
@{Html.Action("OrderSummary", "AdminDeshboard");}
</td>
</tr>
两个 Webgrid 都正确显示,但是当我更改页面时,一个 Webgrid 另一个 Webgrid 也受影响
这是我的 Webgrid 代码
<fieldset>
@{
ViewBag.Title = "WebGrid with Custom Paging, Sorting";
WebGrid grid1 = new WebGrid(rowsPerPage: Model.PageSize);
grid1.Bind(Model.Order,
autoSortAndPage: false,
rowCount: Model.TotalRows
);
}
@grid1.GetHtml(
fillEmptyRows: false,
alternatingRowStyle: "alternate-row",
headerStyle: "grid-header",
footerStyle: "grid-footer",
mode: WebGridPagerModes.All,
firstText: "<< First",
previousText: "< Prev",
nextText: "Next >",
lastText: "Last >>",
columns: new[] {
grid1.Column("OrderId",header: " OrderId ",style:"Width=100px"),
grid1.Column("FirstName",header: " FirstName "),
grid1.Column("LastName",header: " LastName "),
grid1.Column("CartTotal",header: " CartTotal ",style:"Width=100px")
})
</fieldset>
当我像这样更改页面 url localhost:49424/HomeAdmin?page=2 它对两个网格都有影响,
有什么办法让我更改页面名称
**page ---> Orderpage**
请指导我
谢谢