【发布时间】:2013-03-12 09:27:54
【问题描述】:
我想要链接http://localhost:2409/Account/Confirmation/16 和链接http://localhost:2409/Account/Confirmation/(不带参数)。
但是使用这种操作方法,它不起作用。为什么?
public ActionResult Confirmation(int id, string hash)
{
Some code..
return View();
}
其次,如果参数为空,我只想返回视图。
public ActionResult Confirmation()
{
return View();
}
错误(翻译):
当前对控制器的操作请求确认 AccountController 在以下方法之间有歧义 动作:System.Web.Mvc.ActionResult 确认(Int32, System.String) 用于类型 TC.Controllers.AccountController System.Web.Mvc.ActionResult Confirmation() 用于类型 TC.Controllers.AccountController
【问题讨论】:
标签: asp.net-mvc