예제 #1
0
        /// <summary>
        /// Pager the specified ajax, totalPageCount, pageIndex, actionName, controllerName, routeName, pagerOptions,
        /// routeValues, ajaxOptions and htmlAttributes.
        /// </summary>
        /// <param name="ajax">Ajax.</param>
        /// <param name="totalPageCount">Total page count.</param>
        /// <param name="pageIndex">Page index.</param>
        /// <param name="actionName">Action name.</param>
        /// <param name="controllerName">Controller name.</param>
        /// <param name="routeName">Route name.</param>
        /// <param name="pagerOptions">Pager options.</param>
        /// <param name="routeValues">Route values.</param>
        /// <param name="ajaxOptions">Ajax options.</param>
        /// <param name="htmlAttributes">Html attributes.</param>
        public static HtmlString Pager(this AjaxHelper ajax, int totalPageCount, int pageIndex, string actionName, string controllerName, string routeName, PagerOptions pagerOptions, RouteValueDictionary routeValues, AjaxOptions ajaxOptions, IDictionary <string, object> htmlAttributes)
        {
            var builder = new PagerBuilder(ajax, actionName, controllerName, totalPageCount, pageIndex, pagerOptions,
                                           routeName, routeValues, ajaxOptions, htmlAttributes);

            return(new HtmlString(builder.RenderPager()));
        }
예제 #2
0
        /// <summary>
        /// Ajaxs the pager.
        /// </summary>
        /// <returns>The pager.</returns>
        /// <param name="html">Html.</param>
        /// <param name="totalPageCount">Total page count.</param>
        /// <param name="pageIndex">Page index.</param>
        /// <param name="actionName">Action name.</param>
        /// <param name="controllerName">Controller name.</param>
        /// <param name="routeName">Route name.</param>
        /// <param name="pagerOptions">Pager options.</param>
        /// <param name="routeValues">Route values.</param>
        /// <param name="ajaxOptions">Ajax options.</param>
        /// <param name="htmlAttributes">Html attributes.</param>
        public static string AjaxPager(this HtmlHelper html, int totalPageCount, 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 builder = new PagerBuilder(html, actionName, controllerName, totalPageCount, pageIndex, pagerOptions,
                                           routeName, routeValues, ajaxOptions, htmlAttributes);

            return(builder.RenderPager());
        }
예제 #3
0
        /// <summary>
        /// Pager the specified helper, totalPageCount, pageIndex, actionName, controllerName, pagerOptions, routeName,
        /// routeValues and htmlAttributes.
        /// </summary>
        /// <param name="helper">Helper.</param>
        /// <param name="totalPageCount">Total page count.</param>
        /// <param name="pageIndex">Page index.</param>
        /// <param name="actionName">Action name.</param>
        /// <param name="controllerName">Controller name.</param>
        /// <param name="pagerOptions">Pager options.</param>
        /// <param name="routeName">Route name.</param>
        /// <param name="routeValues">Route values.</param>
        /// <param name="htmlAttributes">Html attributes.</param>
        public static HtmlString Pager(this HtmlHelper helper, int totalPageCount, int pageIndex, string actionName, string controllerName, PagerOptions pagerOptions, string routeName, object routeValues, object htmlAttributes)
        {
            var builder = new PagerBuilder
                          (
                helper,
                actionName,
                controllerName,
                totalPageCount,
                pageIndex,
                pagerOptions,
                routeName,
                new RouteValueDictionary(routeValues),
                new RouteValueDictionary(htmlAttributes)
                          );

            return(new HtmlString(builder.RenderPager()));
        }