I have a route like
routes.MapRoute(
"Reports", // Route name.
"reports/{controller}/{action}/{id}/{start}/{end}", // URL with parameters.
new { controller = "Home", action = "Index", id = "", start="", end="" } // Parameter defaults.
);
where start
and end
are DateTime?
When I write an Html.ActionLink, it generates the route using the DateTime.ToString
method. Those dates have forward slashes in them which disrupts the route. I'd like to somehow control the route generation to generate ISO 8601 date strings.
Ideally I don't want to have to change my Actions to take strings and convert in my code, I'd like to signal the route generator to call the appropriate ToString
overload of my choice.