在使用MVC IIS7路由经典ASP [英] Classic ASP using MVC routing on IIS7

查看:308
本文介绍了在使用MVC IIS7路由经典ASP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一关,我发现了一些有趣的经过。

After taking the first hurdle, I found something amusing.

直接访问(即 /OLD/ASP/myFile.asp )的网页作品(哦,不,但它返回一个似是而非的ASP错误)。)

Direct access (i.e. /OLD/ASP/myFile.asp) to the page works (well, no, but it returns a plausible ASP error ;) ).

然而,试图航线的页面,如:

However, trying to route the page such as:

routes.MapPageRoute(
        "OldASP",
        "Page/{*id}",
        "~/OLD/ASP/myFile.asp",
        false,
        new RouteValueDictionary(),
        new RouteValueDictionary(new { @id = @"\d+" })
    );

返回壮美
 没有为扩展名的.asp。错误(如上所述它最初是为解决直接访问)

Returns the magnificant There is no build provider registered for the extension '.asp'. error (which was originally solved for direct access as described above)

我怎样才能保持路线和ASP? (试过无济于事)

How can I keep routes and ASP? (tried this to no avail)

推荐答案

我会感到惊讶,如果你能在.NET MVC项目中使用经典ASP页。你当然可以使用的.aspx和.ASP在同一个网站的网页

I'd be surprised if you can use Classic ASP pages within a .net mvc project. You can certainly use .aspx and .asp pages in the same website

您最好的选择可能是使用的web.config和重写模块

Your best bet is probably to use web.config and the rewrite module

http://www.surfingsuccess.com/asp/iis -url-rewrite.html#.UtaDhkA15tA

有一点需要注意,如果你使用asp.net MVC再有就是对web.config文件和MVC自己的路由系统

One thing to watch out for, if you're using asp.net MVC then there is potential for conflicts between web.config and MVC's own routing system

看看这个问题,
IIS URL重写ASP

这篇关于在使用MVC IIS7路由经典ASP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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