I can't find the homepage for my ASP.NET MVC site :(

Posted by Pure.Krome on Stack Overflow See other posts from Stack Overflow or by Pure.Krome
Published on 2010-06-17T06:41:22Z Indexed on 2010/06/17 6:43 UTC
Read the original article Hit count: 137

Hi folks,

really simple question here.

when I remove the default route, I returns an empty page to the browser :-

routes.MapRoute(
    "Default", // Route name
    "{controller}/{action}/{id}", // URL with parameters
    new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

Now before everyone starts shouting "that's because that's the default route to access all action methods, etc.." .. i know that.

My question is - what code / routes does the default framework try and call .. which makes that Default Route get used/kick in?

Why? I don't wish to make that my default route regex (don't ask why - this is some R&D) but I still need the main home page .. ie. Home/Index . If i try and just add that route, it doesn't get called and an empty page is returned.

So -- what does the framework try and call when a user doesn't provide any urls? It's like there's some secret default document stuff set up?

Cheers :)

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about routing