ASHX处理程序与ASP.NET MVC 3剃须刀 [英] ASHX handler with ASP.NET MVC 3 and Razor

查看:170
本文介绍了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}");

这篇关于ASHX处理程序与ASP.NET MVC 3剃须刀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆