Czy jest możliwość w ścieżce routingu podać więcej niż 1 parametr i później w odpowiedniej akcji się posługiwać tymi kilkoma parametrami ?
0
0
Tak, oczywiście.
Routing:
routes.MapRoute(
name: "SuperEkstra",
url: "SuperEkstra/{id}-{test}",
defaults: new { controller = "Home", action = "Test", id = UrlParameter.Optional, test = UrlParameter.Optional }
);
Akcja:
public ActionResult Test(int id, string test)
{
ViewBag.Id = id;
ViewBag.Test = test;
return View();
}