Asp.net MVC routes ending with file extensions
I have an action that returns a Dynamically Generated image however I need the call to that action to end with a something.jpg.
This answer is very similar to my action Can an ASP.NET MVC controller return an Image?
MY action takes in a string called ID which I intend to pass the Something.jpg but my pr开发者_如何学JAVAoblem is that while this works locally when I deploy to my server and try it I get an IIS 7 404 error.
It looks like IIS is trying to find the final rather than calling the action, at no point is the action called.
I've tried adding the following to the global.asax to force it to call the action but to no avail.
routes.RouteExistingFiles = true;
routes.IgnoreRoute("Content/{*pathInfo}");
Could it be an issue with Mime types?
You may need to set your IIS 7 Application Pool in Integrated mode.
精彩评论