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

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -