码迷,mamicode.com
首页 > Web开发 > 详细

.Net绑定双层Repeater

时间:2017-10-09 19:37:56      阅读:266      评论:0      收藏:0      [点我收藏+]

标签:ppi   wrap   send   data   template   eset   tap   双层   obj   

 

                <asp:Repeater ID="rptTitlelist" runat="server" OnItemDataBound="rptTitlelist_OnItemDataBound">
                    <ItemTemplate>
                        <tr>
                            <td colspan="2" class="tabledata" style="font-size: 18px;">
                                <strong>
                                    <%#Eval("Name")%></strong>
                            </td>
                        </tr>
                        <asp:Repeater ID="rptQuestionList" runat="server">
                            <ItemTemplate>
                                <tr>
                                    <td class="tabledata">
                                        <a href="javascript:void(0)" onclick="onClickTab(‘1‘,167,this)" title="上传文件">
                                            <%# Container.ItemIndex + 1%>、<%#Eval("CategoryName")%></a>
                                    </td>
                                    <td class="tabledata">
                                        <a id="get_id_<%#Eval("PKID")%>" href="javascript:;" onclick="LayerOpen(<%#Eval("PKID")%>,‘<%#Eval("CategoryName") %>‘);"
                                            style="white-space: nowrap;">上传文件</a>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </ItemTemplate>
                </asp:Repeater>


        #region 绑定提交资料信息
        /// <summary>
        ///  绑定提交资料信息
        /// </summary>
        private void RptTitleBind()
        {
            // 上传文件列表
            rpApplicationFileList.DataSource = new BLL.ApplicationFileSet().GetApplicationFileList(appId);
            rpApplicationFileList.DataBind();
            rptTitlelist.DataSource = new BLL.AppFileCategory().GetAppFileCategoryList(standardTypeId);
            rptTitlelist.DataBind();
        }

        // 判断里层repeater处于外层repeater的哪个位置
        protected void rptTitlelist_OnItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Repeater rep = e.Item.FindControl("rptQuestionList") as Repeater;
                DataRowView rowv = (DataRowView)e.Item.DataItem;
                int categoryId = Utils.StrToInt(rowv["PKID"].ToString(), 0);
                rep.DataSource = new BLL.ApplicationFileSet().GetApplicationFileSetID(categoryId, standardTypeId);
                rep.DataBind();
            }
        }
        #endregion

.Net绑定双层Repeater

标签:ppi   wrap   send   data   template   eset   tap   双层   obj   

原文地址:http://www.cnblogs.com/ment/p/7642388.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!