MVC 3 action not working

I have a working application in asp.net MVC3. Today, when I worked on it in VS2010, I found that none of the actions of a particular controller work. When viewing the controller / action, I get a message not found by the page. I checked all the pages (controller, view). Even if I add a new action to this controller, it will not be called at all. At the same time, the actions of other controllers work fine. I can access the pages. This is pretty weird, and I can't figure it out. Any help?

Edit:

Controller action that does not work, http: // localhost: 7400 / Registration / MedicalHistory / 0

Code from global.asax

 public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        // Home and error page
        routes.MapRoute("error", "error", new { controller = "Home", action = "Error" });

        //Default routing
        routes.MapRoute(
            "Default",                                              // Route name
            "{controller}/{action}/{id}",                           // URL with parameters
            new { controller = "Program", action = "Index", id = UrlParameter.Optional },  // Parameter defaults
            new string[] { "ASPNETMVCApplication.Controllers" }
        );

        //Admin routing
        routes.MapRoute(
             "Admin", // Route name
             "{controller}/{action}/{id}", // URL with parameters
             new { controller = "Program", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
             new string[] { "ASPNETMVCApplication.Areas.Admin.Controllers" }
        );            
    }

Health Care Action:

   [HttpGet]
    public ActionResult MedicalHistory(int id = 0)
    {
      //some code
      return View()
    }
+3
source
4

, . , MVC, Areas/{ }, . Areas/Admin, , Views.

, AreaRegistration , , AreaName RegisterArea().

Global.asax.cs Application_Start() AreaRegistration.RegisterAllAreas();.

RouteDebug web.config, Application_Start(), . . , .

+3

, . , URL, .

, URL, . .

+1
+1

I had a similar problem after renaming the controller. I looked at the dispatcher folder several times. Totally forgot to rename it.

+1
source

All Articles