我有兩種方法:在asp.net mvc中的Actions中含糊不清,如何解決它?
public ActionResult Index(int? id)
{
return Redirect("/View/" + this.GetMenuItems().First().Id);
}
public ActionResult Index(int id, uint? limit)
{
,當我去/查看/ 1 - 我得到這個錯誤
他的行動控制器類型「索引」當前請求「視圖控制器」不明確以下動作的方法之間: System.Web.Mvc.ActionResult指數(System.Nullable 1[System.Int32]) on type SVNViewer.Controllers.ViewController System.Web.Mvc.ActionResult Index(Int32, System.Nullable
1 [System.UInt32])上式SVNViewer.Controllers.ViewController
我需要這兩種方法,但刪除不明確的錯誤,我該怎麼做?
重命名的方式到別的一個:第二個方法首頁 - > MenuItem也許?或者,在第二個參數中設置限制參數(不可爲空)。 – Tommy
@Tommy如果你回答爲回答 – VJAI
@Mark - 我很欣賞,但我沒有足夠的時間來制定一個很好的答案,當我遇到這個,但想扔在我的2美分爲testCoder! – Tommy