I need a feedback on a routing-related issue I've found while publishing an ASP.NET MVC 2 application. In the global.asax file I defined the following routes:
// Thumbnails routing.
// Sample URL: resizer/resizeImage/200/200/Error/error.jpg
routes.MapRoute("Resizer","Resizer/{action}/{width}/{height}/{folder}/{file}",
new { controller = "Resizer", action = "ResizeImage", width = 100,height = 100,
folder = "Error", file = "error.jpg"
}
);
// Default routing.
// Sample URL: /Home/Index
routes.MapRoute("Default", "{controller}/{action}.aspx/{id}",
new { controller = "Home", action = "Index", id = (string)null }
);
So, firstly I had to add .aspx for the default routing otherwise the hosting server (Aruba) does not perform properly routing... so first question: is there any other workaround to maintain normal routing (i.e. without adding .aspx)?
The 'Resizer' route should allow to call a controller that should generate thumbnails images: It works locally but not when the web site is published.
It seems that the route like 'resizer/resizeImage/200/200/Error/error.jpg' is not recognized.
How can I handle this issue?