I am trying to add a mvc route to generate a javascript from the controller. I have added the following route and it doesn\'t work:
routes.MapRouteWithName(
how do I make this work?
IIS intercepts the request because it contains a file extension and hijacks it thinking it is a static file and not passing it to your application.
To make it work you should tell IIS not to do that. Inside the
section you could add the following handler to indicate that requests with the specified pattern should be handled by the managed pipeline:
...
Some people might also tell you to use:
but I wouldn't recommend you doing that because this means that all requests to static resources will now be flowing through the managed pipeline which could have a negative performance overhead for your application. The handler syntax allows you to selectively enable this only for certain route patterns and HTTP verbs.