我是使用MVC的新手,所以我想我应该试一试。
我的ActionLink有个问题:
foreach (var item in areaList)
{
using (Html.BeginForm())
{
<p>
@Html.ActionLink(item.AreaName, "GetSoftware","Area", new { id = 0 },null);
</p>
}
}GetSoftware是我的动作,Area是我的控制器。
我的错误:
The parameters dictionary contains a null entry for parameter 'AreaID' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult GetSoftware(Int32)我的操作:
public ActionResult GetSoftware(int AreaID)
{
return View();
}我在这里查看了同样的问题,我遵循了回复,但仍然是同样的错误。有人知道出了什么问题吗?
发布于 2013-07-20 21:51:43
操作的参数名称不匹配。只需使用以下命令:
@Html.ActionLink(item.AreaName, "GetSoftware", "Area", new { AreaID = 0 }, null);发布于 2013-07-20 21:51:53
@Html.ActionLink(item.AreaName, "GetSoftware","Area", new {AreaID = 0 },null);发布于 2013-07-20 21:57:13
@Html.ActionLink(item.AreaName, "GetSoftware","Area", new {AreaID = 0 },null);我想这对你会有用的。
https://stackoverflow.com/questions/17762890
复制相似问题