I am trying to create another controller for my Ajax handler – so now I have an AppController (The site controller) and an AjaxController (the Ajax request handler).
The problem is, that when I access http://LocalHost:82/Ajax , I get The resource cannot be found. When I access http://LocalHost:82/Ajax/Index , it works.
The problem is the default routing, right? Here is my routing:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "App", action = "NewRequests", id = UrlParameter.Optional } // Parameter defaults
);
If you need more info dont hesitate to ask. Thanks!
Your routing:
Declares that default action is NewRequests, so it is expected that your AjaxController would have [HttpGet] NewRequests actions. You can do that by,
or