ASP.NET MVC Missing default action for only one controller

I don't know what happened to my site. As of today, the default "Index" action in only one controller no longer works. If I call http://website.com/Valuation I get a 403 error page because the webserver is not redirecting my request and trying to view the folder. If I write http://website.com/Valuation/Index everything works. I search all over the code, but I can't find the problem, everything seems to be fine, just like other controllers.

How can I find the problem? Do you know if there is a known issue causing this issue, or do you know if there is a trace \ log \ routing request debugger?

thank

Microphone

+3


source to share


2 answers


Most likely the problem is that you have a folder named Score in your root website . This is why the rating index action does not work. Instead of routing to the Controller action, the URL http://website.com/Valuation is routed to the Score folder .

Either remove that Score folder from your root or rename it, then this url http://website.com/Valuation will work.



Also check if the ValuationController object has a public method ActionResult Index () ([HttpGet].

+3


source


Check file ~ \ App_Start \ RouteConfig.cs



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

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional}
            );
        }
    }

      

0


source







All Articles