Tag: maproute

MVC路由静态文件

我正在使用传统的swf文件,该文件在控制器/操作路由中查找静态路由。 例如,它正在尝试下载该文件 http://localhost:59801/Resource/Details/ClearExternalPlaySeekMute.swf 当文件存在于根目录中时: http://localhost:59801/ClearExternalPlaySeekMute.swf 我可以使用MapRoute将此URL映射到根目录吗?

C#MVC 4 ControllerName属性

我正在为我的MVC 4控制器提供友好的名称,我想做一些像[ActionName=”My-Friendly-Name”]样式的东西,但对于整个控制器。 我找不到关于这种属性的任何信息,那么我该如何去做呢? 另外,我需要添加一个新的MapRoute来处理它吗? 编辑: 例如,我想路由以下url: http://mysite.com/my-reports/Details/5 被路由到以下控制器: [ControllerClass=”my-reports”] // This attribute is made up. I’d like to know how to make this functionality public class ReportsController : Controller { // // GET: /Reports/ public ActionResult Index() { return View(); } public ViewResult Details(int id) { Report report = db.Reports.Single(g => g.Id == id); return […]