2012-09-21 76 views
0

我想在nop2.65設置不同的默認頁,我有註冊新幹線如何設置不同的默認頁面中NOPCommerce2.65

//In RouteProvider 
//Custome page 
      routes.MapLocalizedRoute("CustomHome", 
          "", 
          new { controller = "Customer", action = "Login" }, 
          new[] { "Nop.Web.Controllers" }); 

      //home page 
      routes.MapLocalizedRoute("HomePage", 
          "", 
          new { controller = "Home", action = "Index" }, 
          new[] { "Nop.Web.Controllers" }); 

它的做工精細設置的登錄頁面爲默認,但是當我點擊「主頁」菜單重定向登錄頁面 而不是主頁。
我也試圖設置Global.asax文件的默認頁也不起作用

//In Global.asax file 
    routes.MapRoute(
        "Default", // Route name 
        "{controller}/{action}/{id}", // URL with parameters 
        new { controller = "Customer", action = "Login", id = UrlParameter.Optional }, 
        new[] { "Nop.Web.Controllers" } 
       ); 

回答

0

我終於得到了解決在NOP2.65下NOP.Web->基礎設施 - > RouteProvider.cs所有路徑登記。如果要設置不同的路線,那麼你的RouteProvider.cs像

/In RouteProvider 
//Custome page 
      routes.MapLocalizedRoute("CustomHome", 
          "", // Route name 
          new { controller = "Customer", action = "Login" }, 
          new[] { "Nop.Web.Controllers" }); 

      //home page 
      routes.MapLocalizedRoute("HomePage", 
          "home/", // Route name 
          new { controller = "Home", action = "Index" }, 
          new[] { "Nop.Web.Controllers" }); 

注意:設置RouteName爲空白對於新註冊的路線和修改後的首頁RouteName。