tags:

views:

21

answers:

1

I am trying to pass more that 1 default parameters when mapping a route i.e

routes.MapRoute(
            null, 
            "items", 
            new { controller = "Items", action = "Index",  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

+3  A: 

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 }
Jørn Schou-Rode