我需要一点帮助。我正在尝试在 IIS6 上托管 MVC 2 应用程序。在我的开发机器 (XP) 上,它可以在 Cassini 中完美运行,或者在 IIS 中作为网站运行。
首先,我尝试将 .mvc 扩展名引用到 aspnet_isapi,但当这不起作用时,我改用 aspx 扩展名。
有任何想法吗?我可能错过了一些明显的事情。
public class MvcApplication : HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
AreaRegistration.RegisterAllAreas();
routes.MapRoute(
"Default", // Route name
"{controller}.aspx/{action}/{id}", // URL with parameters
new {controller = "Home", action = "Index", id = ""} // Parameter defaults
);
routes.MapRoute(
"Root",
"",
new {controller = "Home", action = "Index", id = ""}
);
}
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
}
}
EDIT:
Had some bad references that i cleaned out and is now stuck with this on my master page:
我认为你应该尝试这个:http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)