• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# WebControls.Repeater类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.UI.WebControls.Repeater的典型用法代码示例。如果您正苦于以下问题:C# Repeater类的具体用法?C# Repeater怎么用?C# Repeater使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Repeater类属于System.Web.UI.WebControls命名空间,在下文中一共展示了Repeater类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BindRepeaterWithPaging

        public static PagedDataSource BindRepeaterWithPaging(ref Repeater objRepeater, int currentPage, string strSelectQuery, string strSearchCondition = "", string strAddNewRow = "")
        {
            //create new instance of PagedDataSource
            PagedDataSource objPds = new PagedDataSource();
            DataSet dsBindData = new DataSet();
            DataView dv = new DataView();

            //set number of pages will appear
            objPds.PageSize = csGlobal.pageSize;
            objPds.AllowPaging = true;

            //Fill DataSet And Create Dataview
            dsBindData = CrystalConnection.CreateDatasetWithoutTransaction(strSelectQuery);
            dv = dsBindData.Tables[0].DefaultView;

            //Filter the DataView According to Search Condition
            if (strSearchCondition != "")
            {
                dv.RowFilter = strSearchCondition;
            }

            objPds.DataSource = dv;

            //Setting CurrentPageIndex, Which page is to be set Current Page
            if (strAddNewRow == "")
                objPds.CurrentPageIndex = currentPage;
            else
                objPds.CurrentPageIndex = objPds.PageCount - 1;

            //Bind the Repeader with PageDataSource
            objRepeater.DataSource = objPds;
            objRepeater.DataBind();

            return objPds;
        }
开发者ID:AAGJKPRT,项目名称:LMT,代码行数:35,代码来源:csGlobalFunction.cs


示例2: btnDelete_Click

        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int sucCount = 0; //成功数量
            int errorCount = 0; //失败数量
            Repeater rptList = new Repeater();
            rptList = this.rptList1;

            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        sucCount++;
                    }
                    else
                    {
                        errorCount++;
                    }
                }
            }
            AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "删除lbs数据管理内容成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("lbslist.aspx", "keywords={0}", this.keywords), "Success");
        }
开发者ID:yi724926089,项目名称:MyWx,代码行数:27,代码来源:lbslist.aspx.cs


示例3: BindCourseware

 public void BindCourseware()
 {
     var repeaters = new Repeater[]
     {A0, A1, A2, A3, A4, A5, A6, B0, B1, B2, B3, B4, B5, B6, C0, C1, C2, C3, C4, C5, C6};
     foreach (var repeater in repeaters)
     {
         Func<ResourceMap, bool> funcWhere;
         Func<ResourceMap, dynamic> funcOrder;
         var index = int.Parse(repeater.ID.Substring(1, 1));
         var order = repeater.ID.Substring(0, 1);
         switch (order)
         {
             case "A":
                 funcOrder = o => o.Time;
                 break;
             case "B":
                 funcOrder = o => o.View;
                 break;
             default:
                 funcOrder = o => o.Credit;
                 break;
         }
         funcWhere =
             o => o.Type == ResourceType.课件 && o.State < State.审核 && o.CatalogId == Courses[index];
         repeater.DataSource = HomoryContext.Value.ResourceMap.Where(predicate: funcWhere).OrderByDescending(funcOrder).Take(10).ToList();
         repeater.DataBind();
     }
 }
开发者ID:Homory-Temp,项目名称:LeYi,代码行数:28,代码来源:HomeCourseware.ascx.cs


示例4: UpdateProfile

 public void UpdateProfile(Repeater rpData, Boolean debugMode = false)
 {
     const string profileupload = "NBStore\\profileupload";
     Utils.CreateFolder(PortalSettings.Current.HomeDirectoryMapPath + profileupload);
     var strXml = GenXmlFunctions.GetGenXml(rpData, "", PortalSettings.Current.HomeDirectoryMapPath + profileupload);
     Save(strXml, debugMode);
 }
开发者ID:fujinguyen,项目名称:NBrightBuy,代码行数:7,代码来源:ProfileData.cs


示例5: btnDelete_Click

        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("weixin_sq", MXEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount = 0; //成功数量
            int errorCount = 0; //失败数量

            Repeater rptList = new Repeater();
            rptList = this.rptList;

            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        sucCount++;
                    }
                    else
                    {
                        errorCount++;
                    }
                }
            }
            AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "删除微信上墙图片成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            Response.Redirect(Utils.CombUrlTxt("photo_list.aspx", "id={0}&keywords={1}",
              aid.ToString(), this.keywords));
        }
开发者ID:yi724926089,项目名称:MyWx,代码行数:30,代码来源:photo_list.aspx.cs


示例6: Loadlist

        public void Loadlist(Repeater rpt)
        {
            try
            {
                int sotin = (_typecat == 0 ? lnews.Getsotin(_Catid) : 100);
                var list = lnews.Load_listnews(_Catid);
                if (list.Count > 0)
                {
                    //if (_page != 0)
                    //{
                    //    rpt.DataSource = list.Skip(sotin * _page - sotin).Take(sotin);
                    //    rpt.DataBind();
                    //}
                    //else
                    //{
                    rpt.DataSource = list;//.Take(sotin);
                    rpt.DataBind();
                    //}
                    //ltrPage.Text = change.result(list.Count, sotin, _cat_seo_url, 0, _page, 1);
                }
                else { }

            }
            catch
            {

            }
        }
开发者ID:htphongqn,项目名称:kibitravel,代码行数:28,代码来源:enListDestinations.ascx.cs


示例7: GetCheckBoxByRepeater

        /// <summary>
        /// 获得Repeater中已选的CheckBox值集合
        /// </summary>
        /// <param name="list">列表控件</param>
        /// <param name="checkId">CheckBox名称</param>
        /// <returns></returns>
        public static string GetCheckBoxByRepeater(Repeater list, string checkId)
        {
            if (list == null)
            {
                throw new ArgumentNullException("list");
            }

            StringBuilder rets = new StringBuilder();
            for (int i = 0; i < list.Items.Count; i++)
            {
                CheckBox check = (CheckBox) list.Items[i].FindControl(checkId);
                if (check.Checked)
                {
                    if (rets.Length > 0)
                    {
                        rets.Append(",");
                        rets.Append(check.Text);
                    }
                    else
                    {
                        rets.Append(check.Text);
                    }
                }
            }
            return rets.ToString();
        }
开发者ID:BGCX261,项目名称:zhuji-cms-svn-to-git,代码行数:32,代码来源:UIControlHelper.cs


示例8: BindMenu

 /// <summary>
 /// BindMenu
 /// </summary>
 /// <param name="web"></param>
 /// <param name="listName"></param>
 /// <param name="rptMenu"></param>
 /// <param name="menuPosition"></param>
 /// <param name="menuParent"></param>
 public static void BindMenu(SPWeb web, string listName, Repeater rptMenu, string menuPosition, string menuParent)
 {
     SPSecurity.RunWithElevatedPrivileges(() =>
     {
         using (var adminSite = new SPSite(web.Site.ID))
         {
             using (var adminWeb = adminSite.OpenWeb(web.ID))
             {
                 try
                 {
                     adminWeb.AllowUnsafeUpdates = true;
                     string caml = @"<Where><And><Eq><FieldRef Name='{0}' /><Value Type='Text'>{1}</Value></Eq><Eq><FieldRef Name='{2}' /><Value Type='MultiChoice'>{3}</Value></Eq></And></Where><OrderBy><FieldRef Name='{4}' /></OrderBy>";
                     var query = new SPQuery()
                     {
                         Query = string.Format(CultureInfo.InvariantCulture, caml, FieldsName.MenuList.InternalName.ParentID, menuParent, FieldsName.MenuList.InternalName.MenuPosition, menuPosition, FieldsName.MenuList.InternalName.MenuOrder)
                     };
                     var list = Utilities.GetCustomListByUrl(adminWeb, listName);
                     var items = list.GetItems(query);
                     if (items != null && items.Count > 0)
                     {
                         rptMenu.DataSource = items.GetDataTable();
                         rptMenu.DataBind();
                     }
                 }
                 catch (SPException ex)
                 {
                     Utilities.LogToULS(ex);
                 }
             }
         }
     });
 }
开发者ID:setsunafjava,项目名称:vpsp,代码行数:40,代码来源:MenuBO.cs


示例9: Loadlist

        public void Loadlist(Repeater rpt)
        {
            try
            {
                int sotin = (_typecat == 0 ? lnews.Getsotin(_Catid) : 100);
                var list = lnews.Load_listnews(_Catid);
                if (list.Count > 0)
                {
                    if (_page != 0)
                    {
                        rpt.DataSource = list.Skip(sotin * _page - sotin).Take(sotin);
                        rpt.DataBind();
                    }
                    else
                    {
                        rpt.DataSource = list.Take(sotin);
                        rpt.DataBind();
                    }
                    ltrPage.Text = change.result(list.Count, sotin, _cat_seo_url, 0, _page, 1);
                }
                else { lblMsg.Text = "Nội dung đang được cập nhật!"; }

            }
            catch (Exception)
            {

                throw;
            }
        }
开发者ID:htphongqn,项目名称:ecobuild,代码行数:29,代码来源:ListNews.ascx.cs


示例10: btnSave_Click

 //保存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.Edit.ToString()); //检查权限
     BLL.article bll = new BLL.article();
     Repeater rptList = new Repeater();
     switch (this.prolistview)
     {
         case "Txt":
             rptList = this.rptList1;
             break;
         default:
             rptList = this.rptList2;
             break;
     }
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         bll.UpdateField(id, "sort_id=" + sortId.ToString());
     }
     AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "保存" + this.channel_name + "频道内容排序"); //记录日志
     JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
         this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
 }
开发者ID:LutherW,项目名称:MTMS,代码行数:29,代码来源:article_list.aspx.cs


示例11: btnAudit_Click

 //批量审核
 protected void btnAudit_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("channel_" + this.channel_name + "_list", DTEnums.ActionEnum.Audit.ToString()); //检查权限
     BLL.article bll = new BLL.article();
     Repeater rptList = new Repeater();
     switch (this.prolistview)
     {
         case "Txt":
             rptList = this.rptList1;
             break;
         default:
             rptList = this.rptList2;
             break;
     }
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             bll.UpdateField(id, "status=0");
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Audit.ToString(), "审核" + this.channel_name + "频道内容信息"); //记录日志
     JscriptMsg("批量审核成功!", Utils.CombUrlTxt("article_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
         this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property));
 }
开发者ID:sfwjiao,项目名称:MyTestProject,代码行数:28,代码来源:article_list.aspx.cs


示例12: btnDelete_Click

        //批量删除
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("channel_" + this.channel_name + "_list", MXEnums.ActionEnum.Delete.ToString()); //检查权限
            int sucCount = 0; //成功数量
            int errorCount = 0; //失败数量
            BLL.article bll = new BLL.article();
            Repeater rptList = new Repeater();
            rptList = this.rptList1;

            for (int i = 0; i < rptList.Items.Count; i++)
            {
                int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
                CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    if (bll.Delete(id))
                    {
                        sucCount++;
                    }
                    else
                    {
                        errorCount++;
                    }
                }
            }
            AddAdminLog(MXEnums.ActionEnum.Edit.ToString(), "删除" + this.channel_name + "单页内容成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
            JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("article_page_list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
                this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
        }
开发者ID:yi724926089,项目名称:MyWx,代码行数:30,代码来源:article_page_list.aspx.cs


示例13: btnDelete_Click

 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("link", OSEnums.ActionEnum.Delete.ToString()); //检查权限
     int sucCount = 0; //成功数量
     int errorCount = 0; //失败数量
     BLL.contents.article bll = new BLL.contents.article();
     Repeater rptList = new Repeater();
       rptList = this.rptList1;
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             if (bll.Delete(id))
             {
                 sucCount++;
             }
             else
             {
                 errorCount++;
             }
         }
     }
         AddAdminLog(OSEnums.ActionEnum.Edit.ToString(), "删除[搜索-"+this.keywords+"]频道内容成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
         Response.Redirect(Utils.CombUrlTxt("search.aspx", "keywords={0}", this.keywords));
 }
开发者ID:eyren,项目名称:OScms,代码行数:28,代码来源:search.aspx.cs


示例14: InitializeSkin

 protected override void InitializeSkin(System.Web.UI.Control Skin)
 {
     Repeater1 = (Repeater)Skin.FindControl("Repeater1");
     Button1 = (Button)Skin.FindControl("Button1");
     Button1.Click += new EventHandler(Button1_Click);
     DataBind();
 }
开发者ID:LittlePeng,项目名称:ncuhome,代码行数:7,代码来源:Message.cs


示例15: btnSave_Click

 //保存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     BLL.goods bll = new BLL.goods();
     Repeater rptList = new Repeater();
     switch (this.prolistview)
     {
         case "Txt":
             rptList = this.rptList1;
             break;
         default:
             rptList = this.rptList2;
             break;
     }
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         bll.UpdateField(id, "sort_id=" + sortId.ToString());
     }
     JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
     this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
 }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:27,代码来源:list.aspx.cs


示例16: btnDelete_Click

 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel(category_name, OSEnums.ActionEnum.Delete.ToString()); //检查权限
     int sucCount = 0; //成功数量
     int errorCount = 0; //失败数量
     BLL.contents.article bll = new BLL.contents.article();
     Repeater rptList = new Repeater();
     switch (this.prolistview) {
         case "Img":
             rptList = this.rptList1;
             break;
         case "Txt":
             rptList = this.rptList2;
             break;
         default:
             rptList = this.rptList1;
             break;
     }
     for (int i = 0; i < rptList.Items.Count; i++) {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked) {
             if (bll.Delete(id)) {
                 sucCount++;
             }
             else {
                 errorCount++;
             }
         }
     }
     AddAdminLog(OSEnums.ActionEnum.Edit.ToString(), "删除" + this.category_name + "频道内容成功" + sucCount + "条,失败" + errorCount + "条"); //记录日志
     Response.Redirect(Utils.CombUrlTxt("article_list.aspx", "category_id={0}&keywords={1}&property={2}",
     this.category_id.ToString(), this.keywords, this.property));
 }
开发者ID:eyren,项目名称:OScms,代码行数:35,代码来源:article_list.aspx.cs


示例17: btnDelete_Click

 //批量删除
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ChkAdminLevel(channel_id, DTEnums.ActionEnum.Delete.ToString()); //检查权限
     BLL.goods bll = new BLL.goods();
     Repeater rptList = new Repeater();
     switch (this.prolistview)
     {
         case "Txt":
             rptList = this.rptList1;
             break;
         default:
             rptList = this.rptList2;
             break;
     }
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             bll.Delete(id);
         }
     }
     JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("list.aspx", "channel_id={0}&category_id={1}&keywords={2}&property={3}",
     this.channel_id.ToString(), this.category_id.ToString(), this.keywords, this.property), "Success");
 }
开发者ID:codefighting,项目名称:shouxinzhihui,代码行数:27,代码来源:list.aspx.cs


示例18: grvData_RowDataBound

        protected void grvData_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            ImageButton ImageButton1 = (ImageButton)e.Row.FindControl("btnDelete");
            if (ImageButton1 != null)
                ImageButton1.Attributes.Add("onClick", "javascript:return confirm('Bạn có muốn xóa không');");

            rptSubCate = (Repeater)e.Row.FindControl("rptSubCate");
        }
开发者ID:raovat,项目名称:develop,代码行数:8,代码来源:Category.aspx.cs


示例19: InitializeSkin

 protected override void InitializeSkin(System.Web.UI.Control Skin)
 {
     repeater1 = (Repeater)Skin.FindControl("repeater1");
     AddCategory = (Button)Skin.FindControl("AddCategory");
     Cate_Name = (TextBox)Skin.FindControl("Cate_Name");
     AddCategory.Click += new EventHandler(AddCategory_Click);
     DataBind();
 }
开发者ID:LittlePeng,项目名称:ncuhome,代码行数:8,代码来源:Category.cs


示例20: DoDetail

 /// <summary>
 /// Display template with moduleid set
 /// </summary>
 /// <param name="rp1"></param>
 /// <param name="moduleId"></param>
 public void DoDetail(Repeater rp1,int moduleId)
 {
     var obj = new NBrightInfo(true);
     obj.ModuleId = moduleId;
     var l = new List<object> { obj };
     rp1.DataSource = l;
     rp1.DataBind();
 }
开发者ID:Lewy-H,项目名称:NBrightBuy,代码行数:13,代码来源:NBrightBuyBase.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.RepeaterCommandEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.RadioButtonList类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap