Fork me on GitHub

PagerOptions.HorizontalAlign property

Gets or sets the horizontal alignment of a MvcPager on the page.

Syntax:

public string HorizontalAlign {get; set;}

Default value:

left

Example:

@Html.Pager(Model,new PagerOptions{HorizontalAlign="right"})

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

HtmlPager:

@Html.Pager(Model).Options(o=>o.SetHorizontalAlign("right"))

AjaxPager:

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

Live demo:

@Html.Pager(Model, new PagerOptions { HorizontalAlign = "right" })
FirstPrev12345678910...NextLast

@Html.Pager(Model).Options(o=>o.SetHorizontalAlign("center"))
FirstPrev12345678910...NextLast