ASHX处理程序与ASP.NET MVC 3剃须刀
我想用 Silverlight的多文件上传,提供ASP.NET MVC 3问题是,我需要用ashx的处理程序来处理文件上传(处理程序是图书馆的一部分)。如何集成与ASP.NET MVC 3的处理器(我用的Razor视图引擎)?
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) ?
我的猜测是,它是比较容易,因为它是一个(较老的?)第三方库的一部分,它更容易只需按照告诉您设置的说明东西在的web.config
。你应该可以忽略请求 *。ashx的
忽略路线 *。ashx的
文件。您应该能够使用这样的事情,但我还没有尝试过自己:
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}");