我想要链接http://localhost:2409/Account/Confirmation/16
和那个链接http://localhost:2409/Account/Confirmation/
(不带参数)。
但是用这个动作方法,它不起作用。为什么?MVC中的重载视图?
public ActionResult Confirmation(int id, string hash)
{
Some code..
return View();
}
秒,我只是想返回查看,如果parametr是空的。
public ActionResult Confirmation()
{
return View();
}
错误(翻译):
用于在控制器的确认动作的当前请求 的AccountController是 动作的下列方法之间暧昧:System.Web.Mvc.ActionResult确认(的Int32, System.String)for TC.Controllers.AccountController System.Web.Mvc.ActionResult Confirmation()for type TC.Controllers.AccountController
我想出了'int?'的相同想法!无论如何感谢,当然还有+1 :) – whoah 2013-03-12 09:42:44