RouteConfig.cs:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Search", action = "Index", id = UrlParameter.Optional }
);
Контроллер:
public class SearchController : Controller
{
public ActionResult Index()
{
return View("Results");
}
}
Теперь это будет работать.
OR
RouteConfig.cs:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Search", action = "Results", id = UrlParameter.Optional }
);
Контроллер:
public class SearchController : Controller
{
public ActionResult Results()
{
return View("");
}
}