Answer the question
In order to leave comments, you need to log in
How to make the right route?
There is a controller with an index method that takes 3 parameters.
routes.MapRoute("Home", "{link}/{sublink}/{filter}", MVC.Home.Index()
.AddRouteValue("link", UrlParameter.Optional)
.AddRouteValue("sublink", UrlParameter.Optional )
.AddRouteValue("filter", UrlParameter.Optional));
How to make a route?
Answer the question
In order to leave comments, you need to log in
1) If it MANDATORY takes 3 parameters - throw out the block
.AddRouteValue("link", UrlParameter.Optional)
.AddRouteValue("sublink", UrlParameter.Optional)
.AddRouteValue("filter", UrlParameter.Optional));
context.MapRoute(
"AreaName_default",
"AreaName/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }, namespace где ищем контроллеры" }
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question