ASHX handler with ASP.NET MVC 3 and Razor

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

+8
asp.net-mvc-3 ashx
source share
2 answers

I assume this is simpler because it is part of a (older?) Third-party library, and it is easier to just follow the instructions that tell you to install something in web.config . You should be able to ignore requests for *.ashx , ignoring routes in *.ashx files. You should use something like this, but I have not tried it myself:

 routes.IgnoreRoute("{resource}.ashx/{*pathInfo}"); 
+16
source share

The problem is that I need to use the ashx handler to handle file uploads

Who told you you need a handler? All that you could do in the handler could be done as a result of the controller. You even have access to the raw Request.InputStream , if necessary.

+9
source share

All Articles