0

我的全局文件中有两条路线。propertydetails 的路线运行良好,但不适用于预订 我使用的链接是。知道为什么它不起作用

      @Html.ActionLinkWithSpan("BookNow", "Create", "Booking", new {item.ProductId,item.ProductName},"gradient-button")

      @Html.ActionLinkWithSpan("MoreDetails", "Index", "PropertyDetails", new        {item.ProductId,item.ProductName},"") 
 routes.MapRoute(
                   "Booking",
                   "Book/{ProductId}/{ProductName}",
                    new { controller = "BookingController", action = "Create", ProductName = UrlParameter.Optional }
               );

        routes.MapRoute(
                    "PropertyDetails",
                    "Details/{ProductId}/{ProductName}",
                     new { controller = "PropertyDetails", action = "Index", ProductName = UrlParameter.Optional }
                );
4

1 回答 1

0

好的,我明白了...刚刚更换

            routes.MapRoute(
            name: "Booking",
            url: "{controller}/{ProductId}/{ProductName}",
            defaults: new { controller = "BookingController", action = "Create", ProductId = UrlParameter.Optional }
        );
于 2013-04-20T06:35:49.163 回答