在控制器上找不到公共操作方法

Bar*_*rka 4 c# asp.net-mvc controller asp.net-mvc-routing

我有以下控制器方法:

public ActionResult GetResults(string viewToReturn, int resultsPerPage, 
          string classification = null, string sessionId = null, int? lastId= null)
{
               ...
}
Run Code Online (Sandbox Code Playgroud)

通过以下url调用上面的方法:

http://localhost:63455/Home/GetResults?viewToReturn=grid&resultsPerPage=30
Run Code Online (Sandbox Code Playgroud)

导致此消息抛出异常:

在控制器'MyWebSite.Controllers.HomeController'上找不到公共操作方法'GetResults'.

这里是RegisterRoutes:

......    
routes.MapRoute("Home", "home/{action}/{*qualifier}",
       new { controller = "Home", action = "Index", qualifier = UrlParameter.Optional });
......
routes.MapRoute("SearchTitle", "{*path}",
       new { controller = "Home", action = "SearchTitle", path = UrlParameter.Optional });
Run Code Online (Sandbox Code Playgroud)

为什么我会收到此错误,如何解决?谢谢!

Bar*_*rka 6

我在方法上有[HttpPost]属性.我可以发誓我之前删除了它,但不知怎的,在我休息一下然后回来之后,我看到了它.删除后,现在一切正常.