当前位置: 首页>>代码示例>>C#>>正文


C# Pager.RenderHtml方法代码示例

本文整理汇总了C#中Pager.RenderHtml方法的典型用法代码示例。如果您正苦于以下问题:C# Pager.RenderHtml方法的具体用法?C# Pager.RenderHtml怎么用?C# Pager.RenderHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pager的用法示例。


在下文中一共展示了Pager.RenderHtml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            var Data = V_Base.Data;
            int catid =  ParentLoad.CatID;

            var products = from nw in Data.CV_Products
                           join cat_ in Data.CV_CatProducts on nw.CatID equals cat_.CatID
                           where (nw.CatID==catid||catid==-1) && (cat_.PortalID==ParentLoad.PortalId)
                           orderby nw.ProductID descending
                           select nw;

            //1 . chuyen truy van thanh list

            PagedList<IB.Common.Entities.CV_Product> pl = new PagedList<IB.Common.Entities.CV_Product>(products, ParentLoad.PageCurr - 1, ParentLoad.PageSize);

            if (pl.Count > 0)
            {
                //2 . gan vao repeater

                rptproducts.DataSource = pl;
                rptproducts.DataBind();

                //3 . chuyen thanh thanh phan trang

                Pager pg = new Pager(ParentLoad.PageSize, ParentLoad.PageCurr, pl.TotalItemCount, ParentLoad.TabId);

                //4. tao thanh phan trang

                pnPaging.Text = pg.RenderHtml();
            }
        }
开发者ID:shahinhemati,项目名称:project-example-a,代码行数:31,代码来源:ProductListFull.ascx.cs

示例2: Pager

        /// <summary>
        /// Контрол пейджер
        /// </summary>
        /// <param name="htmlHelper"><see cref="HtmlHelper"/></param>
        /// <param name="pageInfo"></param>
        /// <returns>HTML текст с пейджером</returns>
        public static MvcHtmlString Pager(this HtmlHelper htmlHelper,
                                          [NotNull] PageInfo pageInfo)
        {
            var pager = new Pager(htmlHelper.ViewContext.RequestContext, pageInfo, Enumerable.Empty<string>());

            pager.Initialize();

            return pager.RenderHtml();
        }
开发者ID:v0id24,项目名称:ByndyuSoft.Infrastructure,代码行数:15,代码来源:HtmlHelperPagingExtensions.cs

示例3: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            tempService = new TempService(this);
            if (!IsPostBack)
            {
                if (ProductID == -1)
                {
                    var products = from nw in Data.CV_Products
                                   join cat_ in Data.CV_CatProducts on nw.CatID equals cat_.CatID
                                   where (nw.CatID == CatID || CatID == -1) && (cat_.PortalID == PortalId)
                                   orderby nw.ProductID descending
                                   select new ProductInfo
                                              {
                                                  Content = nw.Content,
                                                  CreateDate = nw.CreatedDate.Value,
                                                  Id = nw.ProductID,
                                                  ImageThumUrl = GetWebImgOf(LocationImage.Product,nw.ImageName),
                                                  Price = ConvertPrice(nw.Price),
                                                  ShortContent = nw.ShortContent,
                                                  Title = nw.Title,
                                                  Url = WriteUrl(TabId.ToString(), "detailproduct", nw.ProductID.ToString(), nw.Title)
                                              };

                    //1 . chuyen truy van thanh list

                    PagedList<ProductInfo> pl = new PagedList<ProductInfo>(products, PageCurr - 1, PageSize);

                    if (pl.Count > 0)
                    {
                        //2 . gan vao repeater

                        rptproducts.DataSource = pl;
                        rptproducts.DataBind();

                        //3 . chuyen thanh thanh phan trang

                        Pager pg = new Pager(PageSize, PageCurr, pl.TotalItemCount, TabId);

                        //4. tao thanh phan trang

                        pnPaging.Text = pg.RenderHtml();
                    }
                    mv.SetActiveView(vList);
                }
                else
                {
                    ProductDetail c = (ProductDetail)Page.LoadControl(ControlPath + "/ProductDetail.ascx");
                    c.ListProduct = this;
                    c.TempService = this.tempService;
                    c.DataBinding();
                    plhDetail.Controls.Add(c);
                    mv.SetActiveView(vDetail);
                }
            }
        }
开发者ID:shahinhemati,项目名称:project-example-a,代码行数:55,代码来源:ListProducts.ascx.cs


注:本文中的Pager.RenderHtml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。