I\'m using a default route, so that I don\'t need to specify the controller.
routes.MapRoute(
\"Default\",
\"{action}/{id}\",
new { controlle
look at the article in which is explayned how to deploy ASP.NET MVC Application on IIS6
Found the answer! There's a bug in MVC3 when using two consecutive optional UrlParameters, as detailed by Phil Haack, here routing-regression-with-two-consecutive-optional-url-parameters
You need to first declare a version of the route with only one optional parameter. So
routes.MapRoute(
"Default", // Route name
"{action}/{id}", // URL with ONE parameter
new { controller = "Home", action = "Index",
id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"Default_with_page", // Route name
"{action}/{id}/{page}", // URL with TWO parameters
new { controller = "Home", action = "Index",
id = UrlParameter.Optional, page = UrlParameter.Optional }
// Parameter defaults
);
Seems really obvious now. If I'd actually included all the details I'm sure Serghei or someone else would have seen the problem, so thanks for all the help guys!