進出口新的使用MVC,所以我想我會試試看。MVC ActionLink的問題
我有一個問題,我的ActionLink:
foreach (var item in areaList)
{
using (Html.BeginForm())
{
<p>
@Html.ActionLink(item.AreaName, "GetSoftware","Area", new { id = 0 },null);
</p>
}
}
GetSoftware是我的行動,面積是我的控制器。
我的錯誤:
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();
}
我查了這裏同樣的問題,和IM之後的responces,但仍是同樣的錯誤。任何人有一個想法,什麼是錯
您是否嘗試過改變'新{ID = 0}''到新的{areaID表示= 0}' –