Custom route does not work in ASP.net MVC 3
- by user603007
I am trying to implement my custom route in ASP.net MVC 3 but I get this error:
The resource cannot be found. 
global.asax
   public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.MapRoute(
     "mycontroller", // Route name
     "{controller}/{name}", // URL with parameters
     new { controller = "MyController", action = "Search" } // Parameter defaults
 );
    }
MyController.cs
public class MyController : Controller
{
      public ActionResult Search(string name)
    {
        return Content(name);
    }
}