class HomeController
{
public ActionResult Search(int[] sections, int categories)
{
return View();
}
}
i need url like
website.com/search/1,2,3/5
What route map should i use?
At present RegisterRoutes looks
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
use something like:
var result = string.Join(“,”, ints.Select(x => x.ToString()).ToArray());
to build the commaseparated string, and pass it in the route “Search/{csv}/{somevalue}”