I want to customize routes for my products. So I modify a route in
routes.MapLocalizedRoute("Product",
"my-keyword/{SeName}",
new { controller = "Catalog", action = "Product" },
new[] { "Nop.Web.Controllers" });
Error:
The parameters dictionary contains a null entry for parameter 'productId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Product(Int32)' in 'Nop.Web.Controllers.CatalogController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.
Parameter name: parameters
the original route:
routes.MapLocalizedRoute("Product",
"{SeName}",
new {controller = "Catalog", action = "Product"},
new[] {"Nop.Web.Controllers"});
I don't know why this route can pass the Product ID to the action Product. And I don't how to fix the error above. Could anyone help me?