디버깅 할 때 제품 및 하위 범주 링크가 제대로 작동하지만 카테고리는 목록을 표시하지만 각 항목 중 하나를 클릭하여 각 항목을 표시하면 표시되지 않습니다. 아무것도.ASP.NET MVC 5 Traditional Routing
여기가 내 ProductsController.cs입니다. 내가 가지고있는 RouteConfig.cs에
public ActionResult Index(string category, string subcategory, string search, string sortBy, int? page){... }
:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "ProductsCreate",
url: "Products/Create",
defaults: new { controller = "Products", action = "Create" }
);
routes.MapRoute(
name: "ProductsbySubCategorybyPage",
url: "Products/{subcategory}/Page{page}",
defaults: new { controller = "Products", action = "Index" }
);
routes.MapRoute(
name: "ProductsbyCategorybyPage",
url: "Products/{category}/Page{page}",
defaults: new { controller = "Products", action = "Index" }
);
routes.MapRoute(
name: "ProductsbyPage",
url: "Products/Page{page}",
defaults: new { controller = "Products", action = "Index" }
);
routes.MapRoute(
name: "ProductsbySubCategory",
url: "Products/{subcategory}",
defaults: new { controller = "Products", action = "Index" }
);
routes.MapRoute(
name: "ProductsbyCategory",
url: "Products/{category}",
defaults: new { controller = "Products", action = "Index" }
);
routes.MapRoute(
name: "ProductsIndex",
url: "Products",
defaults: new { controller = "Products", action = "Index" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
'Productsbycategory' 경로가 활성화 될 때 표시되는 코드 사용 /보기에 대해 더 자세히 설명해 주어야합니까? (즉, "그 중 하나를 클릭하면 ..."모호합니다) – jhenderson2099