ASP.NET MVC3 not right index page because of routes?

Your Administrace route is swallowing all controllers.

Up vote 0 down vote favorite share g+ share fb share tw.

I have these routes: routes. MapRoute( "ActionOnly", "{action}", new { controller = "Home", action = "Index", id = UrlParameter. Optional }, new { action = "Klub|Historie" }); routes.

MapRoute( "Administrace", // Route name "Administrace/{controller}/{action}/{id}", // URL with parameters new { controller = "Administrace", action = "Index", id = UrlParameter. Optional } // Parameter defaults ); // Hrac/Jmeno_hrace routes. MapRoute( "Hrac", "Hrac/{name}", new { Controller = "Hrac", Action = "Name" } ); // pro aktivaci uzivatele který se registroval, ale jeste nepotvrdil email routes.

MapRoute( "Activate", "Account/Activate/{username}/{key}", new { controller = "Account", action = "Activate", username = UrlParameter. Optional, key = UrlParameter. Optional } ); routes.

MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter. Optional } // Parameter defaults ); Why @Html. ActionLink("Dom?

", "Index", "Home") is creating website.com/Administrace/Home and not website.com/Home/index and how can I fix it? Asp. Net-mvc asp.

Net-mvc-3 routing routes link|improve this question asked Dec 20 '11 at 16:41Bibo3731213 91% accept rate.

Try using @Html. RouteLink instead with the route being default. – aspect Dec 20 '11 at 16:45.

Your Administrace route is swallowing all controllers. You should change it to hard-code the controller name: routes. MapRoute( "Administrace", // Route name "Administrace/Administrace/{action}/{id}", // URL with parameters new { controller = "Administrace", action = "Index", id = UrlParameter.

Optional } // Parameter defaults ); If you want that route to work for multiple controllers, you should replace it with an area (or just add a constraint).

Area looks good but I have little problem with Ninject. It´s not returning controller for my route. Should I change something in ninject?

– Bibo Dec 20 '11 at 17:07 I don't know; search Google for ninject asp.net mvc areas – SLaks Dec 21 '11 at 2:48.

Use @Html. RouteLink instead with the route name being default Link to something that might help: What's the difference between RouteLink and ActionLink in ASP. NET MVC?

Thanks for routelink, it´s working, if I don´t use area from other post, I´ll accept yours :) – Bibo Dec 20 '11 at 17:14.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions