Fork me on GitHub

PagerOptions.RouteName property

Gets or sets the name of the route that is used to generate paging urls.

Syntax:

public string RouteName {get; set;}

Default value:

Route name in the current view context.

Example:

@Html.Pager(Model,new PagerOptions{RouteName="Default"})

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

HtmlPager:

@Html.Pager(Model).Options(o=>o.SetRouteName("Default"))

AjaxPager:

@Ajax.Pager(Model).Options(o=>o.SetRouteName("Default")).AjaxOptions(a=>a.SetUpdateTargetId("target"))

Live demo:

See Using custom routes>>