Fork me on GitHub

PagerOptions.PageIndexOutOfRangeErrorMessage property

Gets or sets the error message to be displayed when page index is oute of range (less than 1 or larger than total pages count).

Syntax:

public string PageIndexOutOfRangeErrorMessage {get; set;}

Default value:

Page index is out of range

Example:

@Html.Pager(Model,new PagerOptions{PageIndexOutOfRangeErrorMessage="Page index should be larger than 0 and less than total pages count"})

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

HtmlPager:

@Html.Pager(Model).Options(o=>o.SetPageIndexOutOfRangeErrorMessage("Page index should be larger than 0 and less than total pages count"))

AjaxPager:

@Ajax.Pager(Model).Options(o=>o.SetPageIndexOutOfRangeErrorMessage("Page index should be larger than 0 and less than total pages count")).AjaxOptions(a=>a.SetUpdateTargetId("target"))