asp.net mvc - how to pass more than 1 default paramters when mapping routes
I am trying to pass more that 1 default parameters when mapping a route i.e
routes.MapRoute(
null,
"items",
new { controller = "Items", action = "Ind开发者_如何学Cex", new { page = 1, pageSize=10 } } //prob here
);
Works fine with 1 parameter like:
routes.MapRoute(
null,
"items",
new { controller = "Items", action = "Index", page = 1 } //prob here
);
Thanks in advance
You are already declaring three default parameters here:
new { controller = "Items", action = "Index", page = 1 }
Adding a fourth is as simple as:
new { controller = "Items", action = "Index", page = 1, pageSize=10 }
精彩评论