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


C# Repeater.DataBind方法代码示例

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


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

示例1: 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 (Exception)
            {

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

示例2: 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

示例3: BindDataToControls

        public void BindDataToControls(Repeater tasksList, Repeater performersList)
        {
            tasksList.DataSource = _tasksService.GetRecentTasks(5);
            performersList.DataSource = _employeService.GetTopPerformers(5);

            tasksList.DataBind();
            performersList.DataBind();
        }
开发者ID:Detroier,项目名称:playground,代码行数:8,代码来源:DefaultPagePresenter.cs

示例4: 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

示例5: InitializeSkin

        protected override void InitializeSkin(System.Web.UI.Control Skin)
        {
            CommentRepeater = (Repeater)Skin.FindControl("NewComment");
            //CommentRepeater.DataSource = BView_WeblogUserComment.GetTopCommentByLogUID(blogContext.BlogUserId);
            CommentRepeater.DataSource = BGetCommentInfoByLogId.GetTopCommentByLogUID(blogContext.BlogUserId);
            CommentRepeater.DataBind();

            //throw new NotImplementedException();
        }
开发者ID:LittlePeng,项目名称:ncuhome,代码行数:9,代码来源:NewestComment.cs

示例6: InitMetadataRepeater

        /// <summary>
        /// Inits the metadata repeater.
        /// </summary>
        /// <param name="pageMetadata">The page metadata.</param>
        /// <param name="metadataTypeName">Name of the metadata type.</param>
        /// <param name="repeater">The repeater.</param>
        protected void InitMetadataRepeater(List<Metadata> pageMetadata, string metadataTypeName, Repeater repeater)
        {
            QueryRequest queryRequestFactory =  QueryRequestFactory.Instance.GetMetadataSubjectInstancesQueryRequest(ModuleCMS.Instance.PageTypes, FoundationContext.Current.LanguageID, FoundationContext.Current.Token);

            List<App_Code.Site.CMS.MetaData.Metadata> metadatas =   MetadataService.Instance.GetMetadatas(queryRequestFactory, ModuleCMS.Instance.PermissionManager,FoundationContext.Current.Token);

            repeater.DataSource = metadatas;
            repeater.DataBind();
        }
开发者ID:huttan1,项目名称:profit,代码行数:15,代码来源:Filter.ascx.cs

示例7: AttachChildControls

        protected override void AttachChildControls()
        {
            rp_productsales = (Repeater)this.FindControl("rp_productsales");

            DataTable lineItems = ProductBrowser.GetLineItems(Convert.ToInt32(this.Page.Request.QueryString["productId"]), this.maxNum);

            rp_productsales.DataSource = lineItems;
            rp_productsales.DataBind();
        }
开发者ID:davinx,项目名称:himedi,代码行数:9,代码来源:Common_ProductSales.cs

示例8: read

 public void read(String instr, Repeater repeater)
 {
     conn.Open();
     SqlCommand cmd = new SqlCommand();
     cmd.CommandText = instr;
     cmd.Connection = conn;
     repeater.DataSource = cmd.ExecuteReader();
     repeater.DataBind();
     conn.Close();
 }
开发者ID:EthanRutherford,项目名称:HelloWorldASP.net,代码行数:10,代码来源:SQL.cs

示例9: bingRepearter

 void bingRepearter(string rootID, Repeater rMenu)
 {
     TreeNodeInfo<MenuInfo> cList = new BLL.Menu().GetTree(rootID);
     if (null == cList)
     {
         return;
     }
     rMenu.DataSource = cList.ChildNodeList;
     rMenu.DataBind();
 }
开发者ID:shanfree,项目名称:SharpReport,代码行数:10,代码来源:Default.aspx.cs

示例10: BindRepeater

        public static void BindRepeater(ref Repeater objRepeater, string strSelectQuery)
        {
            DataSet dsBindData = new DataSet();
            DataView dv = new DataView();

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

            //Bind the Repeader with PageDataSource
            objRepeater.DataSource = dv;
            objRepeater.DataBind();
        }
开发者ID:AAGJKPRT,项目名称:LMT,代码行数:13,代码来源:csGlobalFunction.cs

示例11: Loadcate_index

        public void Loadcate_index(int limit, int type, ref Repeater rp)
        {
            try
            {
                rp.DataSource = index.Load_cate_index(limit, type,0);
                rp.DataBind();
            }
            catch (Exception)
            {

                throw;
            }
        }
开发者ID:htphongqn,项目名称:esell.yeuthietkeweb.com,代码行数:13,代码来源:Main-news.ascx.cs

示例12: CreateRepeater

		private static void CreateRepeater(Control parent)
		{
			Control cellContainer = PrepareCellContainer(parent);

			Repeater repeater = new Repeater();
			cellContainer.Controls.Add(repeater);

			repeater.HeaderTemplate = new RepeaterHeaderTemplate();
			repeater.ItemTemplate = new RepeaterItemTemplate();

			repeater.DataSource = TestData.PrepareData();

			repeater.DataBind();
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:14,代码来源:RepeaterTest.aspx.cs

示例13: Categories

        public static bool? Categories(Repeater userControl, string getstr)
        {
            if (string.IsNullOrEmpty(getstr))
            {
                return null;
            }
            SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
            SqlCommand cmd = new SqlCommand("select discipline_id from discipline where Discipline_name = @name", con);
            cmd.Parameters.AddWithValue("name", getstr);

            try
            {
                con.Open();
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.HasRows)
                {
                    string str = "";
                    while (dr.Read())
                    {
                        str = dr["discipline_id"].ToString();
                        if (!string.IsNullOrEmpty(str))
                            break;
                    }

                    dr.Close();
                    SqlCommand cm = new SqlCommand("select categories_name from categories where discipline_id = @id", con);
                    cm.Parameters.AddWithValue("id", str);
                    dr = cm.ExecuteReader();
                    if (dr.HasRows)
                    {
                        SqlDataSource ds = new SqlDataSource(WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString, cm.CommandText);
                        ds.SelectParameters.Add("id", str);
                        userControl.DataSource = ds;
                        userControl.DataBind();
                        return true;
                    }

                }
                return false;
            }
            catch (Exception)
            {
                return false;
            }
            finally
            {
                con.Close();
            }
        }
开发者ID:juchok,项目名称:testKnowlige,代码行数:49,代码来源:Categorieses.cs

示例14: Load_ads

 public void Load_ads(int position, ref Repeater rp)
 {
     try
     {
         var list = per.Load_slider(position, 1).ToList();
         if (list.Count > 0)
         {
             rp.DataSource = list;
             rp.DataBind();
         }
     }
     catch (Exception ex)
     {
         clsVproErrorHandler.HandlerError(ex);
     }
 }
开发者ID:htphongqn,项目名称:esell.yeuthietkeweb.com,代码行数:16,代码来源:Ads-below-prohighlight.ascx.cs

示例15: Load_ads

 public void Load_ads(int position, ref Repeater rp)
 {
     try
     {
         var list = per.Load_slider(HttpContext.Current.Session["Cat_id"], position, 100).ToList();
         if (list.Count > 0)
         {
             rp.DataSource = list;
             rp.DataBind();
         }
     }
     catch (Exception ex)
     {
         clsVproErrorHandler.HandlerError(ex);
     }
 }
开发者ID:htphongqn,项目名称:ketnoitructuyen.com,代码行数:16,代码来源:Ads-left-menu.ascx.cs


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