Fork me on GitHub

PagerOptions.RouteValues property

Gets or sets the object that contains the parameters for the route used by MvcPager.

Syntax:

public RouteValueDictionary RouteValues {get; set;}

Default value:

Route values in the current view context.

Example:

@Html.Pager(Model,new PagerOptions{RouteValues=new RouteValueDictionary{{"param1","value1"}}})

This property value can also be set via the Options method as bellow:

HtmlPager:

@Html.Pager(Model).Options(o=>o.SetRouteValues(new RouteValueDictionary{{"param1","value1"}}))

AjaxPager:

@Ajax.Pager(Model).Options(o=>o.SetRouteValues(new RouteValueDictionary{{"param1","value1"}})).AjaxOptions(a=>a.SetUpdateTargetId("target"))

Item can be added via AddRouteValue(string key, object value) method:

HtmlPager:

@Html.Pager(Model).Options(o=>o.AddRouteValue("param1","value1"))

AjaxPager:

@Ajax.Pager(Model).Options(o=>o.AddRouteValue("param1","value1")).AjaxOptions(a=>a.SetUpdateTargetId("target"))