2010-02-22 58 views
0

我试图映射一个路由时,通过更多的1默认参数时,通过1个多默认paramters即asp.net mvc的 - 如何绘制路线

routes.MapRoute(
      null, 
      "items", 
      new { controller = "Items", action = "Index", new { page = 1, pageSize=10 } } //prob here 
     ); 

正常工作与像1个参数:

routes.MapRoute(
      null, 
      "items", 
      new { controller = "Items", action = "Index", page = 1 } //prob here 
     ); 

在此先感谢

回答

3

您已经在这里宣布默认参数:

new { controller = "Items", action = "Index", page = 1 } 

添加四分之一很简单,只要:

new { controller = "Items", action = "Index", page = 1, pageSize=10 }