2010-07-30 34 views
0

我是一个完整的新手,的Global.asax不映射到控制器动作,除了默认的ASP.Net MVC2在IIS5.1

我默认是HomeController->指数 当我打, http:// localhost/SampleApplication

它进入索引,但我在HomeController中有另一个操作“Process”。如果我点击 http://localhost/SampleApplication/Home/Process返回找不到资源。

我无法在Visual Studio的执行/开发环境中获得这个或通过在IIS中部署。

我的Global.asax是,

public static void RegisterRoutes(RouteCollection routes) 
     { 
      routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 

      routes.MapRoute(
       "Default", // Route name 
       "{controller}/{action}/{id}", // URL with parameters 
       new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults 
      ); 
     } 

     protected void Application_Start() 
     { 
      AreaRegistration.RegisterAllAreas(); 

      RegisterRoutes(RouteTable.Routes); 
     } 

我不能让这个去正确VS2010 itself.When我执行它在端口1048.So我相信它更多的是与我的理解推出一个开发服务器或global.asax中的代码。

回答

0

您已将此标记为IIS5,但IIS5不支持您开箱即用的漂亮的MVC URL。您将需要使用通配符扩展,否则您需要更改您的网址以包含可以映射到ASP.NET的扩展。见

ASP.NET MVC and IIS 5

Deploy ASP.NET MVC on IIS 5.1 (Windows XP)

+0

他还可以安装IIS快递如果所有他需要的是一个IIS服务器开发上。 http://weblogs.asp.net/scottgu/archive/2010/06/28/introducing-iis-express.aspx – SirDemon 2010-07-30 16:19:12

相关问题