Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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());
        }
Exemplo n.º 3
0
        private static void Initialization(AjaxLinksDataObject dataObject)
        {
            _hasMorePages = false;

            _dataObject = dataObject;
        }