【发布时间】:2015-02-10 21:22:48
【问题描述】:
public ActionResult Countries(int id=0, int from=0)
我的控制器和返回 Country 的 ActionResult。
现在:
@foreach (var item in Model.Matches)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
</tr>
}
我的观点,我如何说 From += 10 并让 ID 与它现在打开的页面中的 ID 保持相同,并且从 DB 中再取 10 个国家?
@Html.ActionLink("next", "Countries", Model.From += 10)
这没用
【问题讨论】:
-
你必须扩展你的模型并使用 Html.HiddenFor() 在你的视图中添加一个隐藏字段。
-
你能解释一下,或者给我一个教程吗?
标签: c# html model-view-controller