ASHX handler with ASP.NET MVC 3 and Razor

kubal5003 picture kubal5003 · Sep 2, 2011 · Viewed 13.7k times · Source

I would like to use Silverlight Multi File Uploader with ASP.NET MVC 3. The problem is that I need to use ashx handler to handle file upload (the handler is part of the library). How can I integrate the handler with ASP.NET MVC 3 (I'm using Razor view engine) ?

Answer

Tomas Jansson picture Tomas Jansson · Sep 2, 2011

My guess is that it is easier because it is part of a (older?) third party library and it easier to just follow the instructions that tells you to set something in web.config. You should be able to ignore requests to *.ashx by ignoring routes to *.ashx files. You should be able to use something like this, but I haven't tried it myself:

routes.IgnoreRoute("{resource}.ashx/{*pathInfo}");