Ejemplo n.º 1
0
        public static MvcHtmlString AjaxPagerAppend <T>(this HtmlHelper html, PageListAppend <T> pagedList, string UpdateTargetId, string ActionName, string ControllerName)
        {
            var localUrl = string.Format(@"{0}://{1}", html.ViewContext.RequestContext.HttpContext.Request.Url.Scheme, html.ViewContext.RequestContext.HttpContext.Request.Url.Authority);
            var url      = string.Format("{0}/{1}/{2}{3}", localUrl, ControllerName, ActionName, html.ViewContext.RequestContext.HttpContext.Request.Url.Query);
            var ui       = new PageUI(url, UpdateTargetId, pagedList.AddParameters);

            return(MvcHtmlString.Create(ui.GetPage(pagedList.PageIndex, pagedList.PageSize, pagedList.TotalCount, false, true)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// ajax方法加载微薄式分页,可以在页面定义appendCss来修改分布按钮样式
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="html"></param>
        /// <param name="pagedList"></param>
        /// <param name="UpdateTargetId"></param>
        /// <returns></returns>
        public static MvcHtmlString AjaxPagerAppend <T>(this HtmlHelper html, PageListAppend <T> pagedList, string UpdateTargetId)
        {
            PageUI ui = new PageUI(html.ViewContext.RequestContext.HttpContext.Request.Url.ToString(), UpdateTargetId, pagedList.AddParameters);

            return(MvcHtmlString.Create(ui.GetPage(pagedList.PageIndex, pagedList.PageSize, pagedList.TotalCount, false, true)));
        }
Ejemplo n.º 3
0
        public static MvcHtmlString PagerAppend <T>(this HtmlHelper html, PageListAppend <T> pagedList)
        {
            PageUI ui = new PageUI(html.ViewContext.RequestContext.HttpContext.Request.Url.ToString(), pagedList.AddParameters);

            return(MvcHtmlString.Create(ui.GetPage(pagedList.PageIndex, pagedList.PageSize, pagedList.TotalCount, 0, new UrlHelper(html.ViewContext.RequestContext), html.ViewContext.RouteData.Values["action"].ToString(), html.ViewContext.RouteData.Values["controller"].ToString(), false, true)));
        }