I am trying to add an area to my application using routing in mvc.net.
For controllers i added:
routes.MapRoute(
"Area1", // Route name
"Area1/{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
how can i route the css/js files in the same way, i.e. i would like to have area1/content/site.css going to /content/site.css or to /content/area1/site.css.
Thanks
I did not find a way of doing this with mvc routing what i ended up doing is:
I ran this code in a http module:
r is a regex in my case:
in global.asax i added:
to prevent mvc.net from routing these requests.
one might also have to set iis6/iis7 to route requests to static files through mvc.net but i forgot the details.
I picked this method up from several posts that i cannot remember so i apologize that i cannot give proper credit.