c# - Passing Two Optional parameter to RedirectToRoute -
i passing 2 nullable parameters products action. forced pass value in mallid
, otherwise no route table matches found
error. want pass null
in mallid
, receive in products
action.
return redirecttoroute("products", new { mallid =(int32?)null, storeid =(int32?)storeproducts.storeid }); [route("mall/{mallid?}/store/{storeid?}/products", name = "products")] public actionresult products(string mallid, long? storeid) { return view(products); }
attribute routing cracking head great too.
[route("mall/{mallid?}/store/{storeid?}/products", name = "products")] public actionresult products(string mallid = null, long? storeid) { return view(products); }
and don't pass in value mallid
Comments
Post a Comment