routes.MapLocalizedRoute("AddProductToCart-Url",
"addproducttocartfromwebsite/{product_id_list}/{shoppingCartTypeId}/{quantity}",
new { controller = "ShoppingCart", action = "AddProductToCart_Catalog_FromUrl" },
new { product_id_list = @"\d+", shoppingCartTypeId = @"\d+", quantity = @"\d+" },
new[] { "Nop.Web.Controllers" });
If I put a number in for "product_id_list", I see the action method getting executed.
What I ultimately need to do is pass some sort of delimited list of IDs where it says "product_id_list". Right now, this only works if I pass in an integer. If I pass in a list or even just some characters that aren't numbers, my action doesn't even get executed: I just get taken to a 404 page and I never see the method get called.
My action method looks like this:
public ActionResult AddProductToCart_Catalog_FromUrl(string product_id_list, int shoppingCartTypeId,
int quantity, bool forceredirection = false)
{
// stuff
}
Is there some way to pass in strings instead of integers here?
Thanks!
Jeremy