【问题标题】:asp.net mvc url routing to /Folder/Folder/Setup.exe?asp.net mvc url 路由到 /Folder/Folder/Setup.exe?
【发布时间】:2013-03-22 03:37:59
【问题描述】:

我可以使用像这样的 ASP.NET MVC URL 而不从 Global.asax 重定向到它吗?:

http://test.com/product/versions/0.9/Setup.exe

这种情况下的产品是Controller/versions/0.9/Setup.exe just a /folder/folder/Setup.exe

它应该如何在我的控制器中? 不采取行动.. 还是?

【问题讨论】:

    标签: asp.net-mvc asp.net-mvc-routing


    【解决方案1】:

    您可以忽略特定扩展的路由:Make routing ignore requests for a file extension

    类似这样的:

    routes.IgnoreRoute("{*setupfiles}", new {setupfiles=@"(.*/)?.exe(/.*)?"});
    

    【讨论】:

      猜你喜欢
      • 2015-02-13
      • 2011-10-10
      • 2015-02-17
      • 1970-01-01
      • 1970-01-01
      • 2013-09-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多