Fork me on GitHub

PagerOptions.GoToButtonId property

Gets or sets the id value of the go to button for the page index box, if this property value is not set, pagechanged event will be fired after value of the pager index box is changed(fired by javascript onchange event).

Syntax:

public string GoToButtonId {get; set;}

Default value:

null

Example:

@Html.Pager(Model,new PagerOptions{GoToButtonId="goBtn"})

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

HtmlPager:

@Html.Pager(Model).Options(o=>o.SetGoToButtonId("goBtn"))

AjaxPager:

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

Live demo:

@Html.Pager(Model,new PagerOptions{PageIndexBoxId="pageBox1",GoToButtonId="goBtn1"})
To to page:<input type="text" id="pageBox1" /><button id="goBtn1">Go</button>
FirstPrev12345678910...NextLast
Go to Page:
@Html.Pager(Model).Options(o => o.SetPageIndexBoxId("pageBox2").SetGoToButtonId("goBtn2"))
Go to Page:<select id="pageBox2"></select><button id="goBtn2">Go</button>
FirstPrev12345678910...NextLast
Go to Page: