zoukankan      html  css  js  c++  java
  • Repeater嵌套

    为上层绑定OnItemDataBound事件
    *.aspx部分代码:
       <asp:Repeater runat="server" ID="repTest" OnItemDataBound="BindDate">
            <ItemTemplate>
                <asp:Repeater runat="server" ID="repDate">
                    <ItemTemplate>
                            Eval("START_DATE")
                    </ItemTemplate>
                </asp:Repeater>
            </ItemTemplate>
        </asp:Repeater>

    *.aspx.cs部分代码
        protected void BindDate(object obj, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Repeater rep = e.Item.FindControl("repDate") as Repeater;
                DataRowView rowView = (DataRowView)e.Item.DataItem;
                string strCode = Convert.ToString(rowView["CODE"]);
                rep.DataSource =  数据源;
                rep.DataBind();
            }
        }

  • 相关阅读:
    MongoDB_聚合
    MongoDB_基本操作
    MongoDB_"Error parsing YAML config file: yaml-cpp: error at line 3, column 9: illegal map value"解决方法
    MongoDB_安装
    beautifulsoup模块
    python发送邮件
    selenium常用操作
    selenium元素定位
    requests模块的高级用法
    继承
  • 原文地址:https://www.cnblogs.com/kuikui/p/2331901.html
Copyright © 2011-2022 走看看