软件下载 | 资讯教程 | 最近更新 | 下载排行 | 一键转帖 | 发布投稿
您的位置:最火下载站 > 网络编程 > ASP.NET > ASP.NET编程:Repeater嵌套

ASP.NET编程:Repeater嵌套

  烈火网(LieHuo.Net)教程 Repeater嵌套

以下为引用的内容:
<asp:Repeater ID="rptSubCategoryList" runat="server">
                  <ItemTemplate>
                    <tr>
                      <td > <%# Eval("CategoryName")%></td>
                    </tr>
                   
                    <asp:Repeater ID="rptSubCategoryListSub" runat="server" DataSource='<%# DataBind(Convert.ToInt32( Eval("ID") )) %>'>
                    <ItemTemplate>
               
                        <tr>
                          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                              <tr>
                               <td>
                                    <%#reqID == Convert.ToInt32(Eval("ID"))%>
                                </td>
                              </tr>
                            </table>
                          </td>
                        </tr>
               
                    </ItemTemplate>
                </asp:Repeater>
               
                  </ItemTemplate>
                </asp:Repeater>


    /**//// <summary>
    /// 绑定到Repeater
    /// </summary>
    protected void DataBind<T>(Repeater rep, List<T> lstCategory)
    {
        rep.DataSource = lstCategory;
        rep.DataBind();
    }

    /**//// <summary>
    /// 绑定到子Repeater
    /// </summary>
    /// <param name="categoryId"></param>
    /// <returns></returns>
    protected List<ContentInfo.Get_Content> DataBind(int categoryId)
    {
        List<ContentInfo.Get_Content> lstContent = new ContentAgent().Get_List(categoryId);
        return lstContent;
    }

    相关阅读
    网友评论
    栏目导航
    推荐软件