X.PagedList
X.PagedList copied to clipboard
FunctionToTransformEachPageLink
We are trying to use the FunctionToTransformEachPageLink but it does not work. Here is the following code: (P.S. on the li we also do not egt the option of InnerHTML. The resulting render for each li looks something like this: Microsoft.AspNetCore.Mvc.Rendering.TagBuilder i.e. the class name as opposed to a Html li element and anchor
new PagedListRenderOptions
{
MaximumPageNumbersToDisplay = 10,
Display = PagedListDisplayMode.IfNeeded,
LiElementClasses = new string[] { "pagination" },
NextElementClass = "next",
LinkToPreviousPageFormat = "❮",
LinkToNextPageFormat = "❯",
LinkToFirstPageFormat = "❮❮",
LinkToLastPageFormat = "❯❯",
FunctionToTransformEachPageLink = (li, a) =>
{
a.AddCssClass("next");
li.SetInnerText(a.ToString());
return li;
}
})