title: ASP.net MVC Image Routing
body: <p>I have an <code>MVC4 application</code>, and i'm trying to generate a route or <code>ihttphandler</code> to process image requests, however this <code>handler or route</code> is never fired.</p>
  
  <p>I have the following route on the <code>route config</code>:</p>
  
  <pre><code>routes.MapRoute("Images", "images/{filename}", new { controller = "Image", action = "ImageRequest" });
  </code></pre>
  
  <p>This way is not working for me when i use it for example to call images/demo.png</p>
  
  <p>I have also tried an <code>IhttpHandler</code> like shown in here without success either:
  <a href="http://www.hanselman.com/blog/BackToBasicsDynamicImageGenerationASPNETControllersRoutingIHttpHandlersAndRunAllManagedModulesForAllRequests.aspx" rel="nofollow">Back To Basics Dynamic Image Generation ASPNET Controllers Routing IHttpHandlers And Run All Managed Modules For All Requests.</a></p>
  
  <p>My <code>web config</code> handler section looks like this:</p>
  
  <pre><code>&lt;!-- language: lang-xml --&gt;
  &lt;add name="Imagehandler jpg" path="/images/*.jpg" verb="*" type="ResponsiveImages.Handlers.ImageHandler, ResponsiveImages.Handlers" /&gt;
  
  &lt;add name="Imagehandler jpeg" path="/images/*.jpeg" verb="*" type="ResponsiveImages.Handlers.ImageHandler, ResponsiveImages.Handlers" /&gt;
  
  &lt;add name="Imagehandler bmp" path="/images/*.bmp" verb="*" type="ResponsiveImages.Handlers.ImageHandler, ResponsiveImages.Handlers" /&gt;
  
  &lt;add name="Imagehandler png" path="/images/*.png" verb="*" type="ResponsiveImages.Handlers.ImageHandler, ResponsiveImages.Handlers" /&gt;
  
  &lt;add name="Imagehandler tiff" path="/images/*.tiff" verb="*" type="ResponsiveImages.Handlers.ImageHandler, ResponsiveImages.Handlers" /&gt;
  </code></pre>
  
  <p>If i have both the handler and the route active, the handler does not get triggered but the route does.</p>
  
  <p>Can anyone tell me what i am doing wrong here?</p>