예제 #1
0
        public static MvcHtmlString Pager(this AjaxHelper ajax, int TotalCount, int pageSize, int pageIndex, string actionName, string controllerName,
                                          string routeName, PagerOptions pagerOptions, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary <string, object> htmlAttributes)
        {
            var totalPageCount = (int)Math.Ceiling(TotalCount / (double)pageSize);
            var builder        = new PagerBuilder(ajax, actionName, controllerName, totalPageCount, pageIndex, pagerOptions,
                                                  routeName, routeValues, ajaxOptions, htmlAttributes)
            {
                PageSize = pageSize, TotalCount = TotalCount
            };

            return(builder.RenderPager());
        }
예제 #2
0
        public static MvcHtmlString AjaxPager(this HtmlHelper html, int TotalCount, int pageSize, int pageIndex, string actionName, string controllerName,
                                              string routeName, PagerOptions pagerOptions, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary <string, object> htmlAttributes)
        {
            if (pagerOptions == null)
            {
                pagerOptions = new PagerOptions();
            }
            pagerOptions.UseJqueryAjax = true;

            var totalPageCount = (int)Math.Ceiling(TotalCount / (double)pageSize);
            var builder        = new PagerBuilder(html, actionName, controllerName, totalPageCount, pageIndex, pagerOptions,
                                                  routeName, routeValues, ajaxOptions, htmlAttributes)
            {
                PageSize = pageSize, TotalCount = TotalCount
            };

            return(builder.RenderPager());
        }
예제 #3
0
        //public static MvcHtmlString Pager<T>(this HtmlHelper helper, IPagedList<T> pagedList, RouteValueDictionary routeValues)
        //{
        //    return Pager(helper, pagedList.TotalCount, pagedList.PageSize, pagedList.PageIndex, null, null, null, null, routeValues, null);
        //}

        public static MvcHtmlString Pager(this HtmlHelper helper, int TotalCount, int pageSize, int pageIndex, string actionName, string controllerName,
                                          PagerOptions pagerOptions, string routeName, object routeValues, object htmlAttributes)
        {
            var totalPageCount = (int)Math.Ceiling(TotalCount / (double)pageSize);
            var builder        = new PagerBuilder
                                 (
                helper,
                actionName,
                controllerName,
                totalPageCount,
                pageIndex,
                pagerOptions,
                routeName,
                new RouteValueDictionary(routeValues),
                new RouteValueDictionary(htmlAttributes)
                                 )
            {
                PageSize = pageSize, TotalCount = TotalCount
            };

            return(builder.RenderPager());
        }