【发布时间】:2013-02-21 21:04:58
【问题描述】:
在我的控制器中,我有以下两种方法;
[ActionName("index")]
public ActionResult Index()
{
return View();
}
and
public ActionResult Index()
{
var m =MyMod();
return View(m);
}
即使我使用了[ActionName("index")],但我收到一条错误消息,指出Error 1 Type 'MyProject.Controllers.MyController' already defines a member called 'Index' with the same parameter types
我怎样才能防止这种情况发生?
【问题讨论】:
-
你想达到什么目的?
-
你当然不能那样做。服务器如何知道要使用哪个操作?
标签: c# asp.net-mvc-3