I have just made a perfect paged list in MVC 5. On each PagedListPager I want to add a CSS class:
@Html.PagedListPager(Model, page => Url.Action("Toetsstart",
new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))
How can I do this?
Adding classes can be done in the PagedListRenderOptions
like so:
@Html.PagedListPager(
model,
page => Url.Action("Index",
new
{
page,
sortOrder = ViewBag.CurrentSort,
currentFilter = viewBag.CurrentFilter
}
),
new PagedListRenderOptions()
{
LiElementClasses = new List<string> {"myClass", "yourClass"}
})
There are a number of places you can put classes, including:
LiElementClasses
ClassToApplyToFirstListItemInPager
ClassToApplyToLastListItemInPager
ContainerDivClasses
UlElementClasses
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With