public static MvcHtmlString BuildPaginationLinks(AjaxHelper helper, AjaxLinksDataObject dataObject) { Initialization(dataObject); var links = BackAjaxLink(helper, dataObject.PageNumber) + " " + ForwardAjaxLink(helper, dataObject.PageNumber, dataObject.PagesCount); return(new MvcHtmlString(!_hasMorePages ? "" : links)); }
private static string BuildAjaxLink(AjaxHelper helper, int pageNumber, int pagesCount) { var dataObject = new AjaxLinksDataObject { PagesCount = pagesCount, PageNumber = pageNumber, ActionName = ActionName, ControllerName = ControllerName, AjaxOptions = new AjaxOptions { UpdateTargetId = _albumId + "", OnSuccess = "go" }, HtmlAttrebutes = new { @class = "btn chooseButton" }, RouteValues = new AlbumRouteValues(_albumId) }; return(AjaxNavigationLinks.BuildPaginationLinks(helper, dataObject).ToString()); }
private static void Initialization(AjaxLinksDataObject dataObject) { _hasMorePages = false; _dataObject = dataObject; }