zoukankan      html  css  js  c++  java
  • 关于Reapter多重嵌套的详细补充

    <asp:Repeater ID ="rptfour" runat ="server" OnItemDataBound="two_Bind">
    <ItemTemplate >
    <div class="Cont_02l" style="margin-right:19px">
    <div class="guanli"><h2><%#Eval("s_name") %></h2><div class="rdr_01">更多>></div></div>
    <asp:Repeater ID ="rptnews" runat ="server" >
    <ItemTemplate >
    <div class="guanli_news">
    <h4><%# Common.FormatString(Eval("sxy_title").ToString (), 22) %></h4>
    <p><%# UploadPicture.interceptStrs(Eval("sxy_content").ToString(), "45")%>…[查看详情]</p>
    </div> 
    </ItemTemplate>
    </asp:Repeater>
    <div class="guanli_list">
    <ul>
    <asp:Repeater ID ="rptlist" runat ="server" >
    <ItemTemplate >
    <li>·<%# Common.FormatString(Eval("sxy_title").ToString (), 36) %></li>
    </ItemTemplate>
    </asp:Repeater>
    </ul>
    </div>
    </div>
    </ItemTemplate>
    </asp:Repeater>
    
    protected void two_Bind(object sender, RepeaterItemEventArgs e)
    {
    News_Bind(e,1);
    }
    protected void four_Bind(object sender, RepeaterItemEventArgs e)
    {
    News_Bind(e, 2);
    }
    protected void News_Bind( RepeaterItemEventArgs e,int c)
    {
    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    {
    Repeater rpttop = e.Item.FindControl("rptnews") as Repeater;
    Repeater rptlist = e.Item.FindControl("rptlist") as Repeater;
    DataRowView drv = (DataRowView)e.Item.DataItem;
    string type = drv.Row["s_oname"].ToString();
    if (rpttop != null && rptlist != null)
    {
    rpttop.DataSource = DB.GetDataTable("top "+c+" .............", "table1", "sxy_type=5 and sxy_tj=1 and sxy_state=1 and sxy_sType='"+type+"'", "sxy_id desc");
    rpttop.DataBind();
    
    rptlist.DataSource = DB.GetDataTable("top 5 ...........", "table1", "sxy_type=5 and sxy_state=1 and sxy_sType='" + type + "' and sxy_id not in (select top 1 sxy_id from College where sxy_type=5 and sxy_tj=1 and sxy_state=1 and sxy_sType='" + type + "' order by sxy_id desc)", "sxy_id desc");
    rptlist.DataBind();
    }
    }
    }
  • 相关阅读:
    OAuth2.0说明文档
    CentOS直接解压可用的memcached、nginx、keepalived
    CentOS离线安装GCC编译环境
    [交通安全]电动自行车认定为非机动车的文件
    修改sublime列编辑快捷键
    手机号归属地接口
    ubuntu下typora的gitee图床配置-----基于picgo
    spyder无法切换中文输入法
    lightgbm直方图算法
    xgboost原理分析
  • 原文地址:https://www.cnblogs.com/candyzhmm/p/4524559.html
Copyright © 2011-2022 走看看