I have a pdf file which I would like to a create a route map for it. Is there a way to make object default take a url in stead of action controller combination?
Instead of
routes.MapRoute("MyRouteName", "MyNiceUrl", new { controller = "ControllerName", action = "ActionName" });
Have something like
routes.MapRoute("MyRouteName", "MyNiceUrl", new { relativeUrl="MyrelativeUrl" });
You don’t need routes for static resources. You need url helpers to reference them:
And if you wanted to have an url like
/SomeController/MyNiceUrlto serve your pdf file you could simply write a controller action:and then: