Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC4 Index Action Not Working Correctly

I have created a controller with an Index action. All of my other Actions return the views just fine...but for some reason I have to specify the full url to have the Index view return. It's almost like my Routes aren't working correctly.

For instance, to go to the properties page, you have to go to /Properties/Index instead of just /Properties/. My routes are as follows. Any help would be greatly appreciated!

routes.MapRoute(
            name: "Index",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );
like image 744
Mark Hardin Avatar asked Jan 07 '13 20:01

Mark Hardin


1 Answers

For security reasons in ASP.NET in general, you can't have a "Properties" path. C# projects all come with a Properties folder by default and ASP will ignore it when accessed directly to prevent file access to it.

like image 154
rossisdead Avatar answered Sep 21 '22 02:09

rossisdead