标题:repeater 嵌套取值 急救啊。。
取消只看楼主
跳过去
Rank: 8Rank: 8
等 级:贵宾
威 望:20
帖 子:282
专家分:976
注 册:2012-8-13
结帖率:91.3%
已结贴  问题点数:20 回复次数:0 
repeater 嵌套取值 急救啊。。


前台:
<asp:Repeater ID="rptTypeTitle" runat="server" OnItemDataBound="rptTity_OnItemDataBound">
     <ItemTemplate>
     <asp:Label ID="lblID" runat="server" Text=' <%#Eval("ID") %> '></asp:Label>
     <div class="MianPageDiv">
          <table border="2">
                <tr>
                <td colspan="2">
                <%#Eval("TypeName")%></td>
                 
                </tr>
            <asp:Repeater ID="rptPostTity" runat="server">
            <ItemTemplate>
               
            <tr>
            <td style="text-align:center"><b>用户头像</b></td>
            <td>时间</td>
            </tr>
            <tr>
             <td rowspan="2">
             <asp:Image ID="Image1" runat="server" /> <br />用户名称
             </td>
             <td rowspan="2">标题</td>
             </tr>
             </ItemTemplate>
             /asp:Repeater>
            </table>
       </div>
    </ItemTemplate>

后台:
    public void rptTity_OnItemDataBound(object sender,RepeaterItemEventArgs e)
        {
            Repeater rptPostTity = e.Item.FindControl("rptPostTity") as Repeater;
            //Label lblid = e.Item.FindControl("lblID") as Label;
            //int id =Int32.Parse(lblid.Text);
            MianPageManage mian = e.Item.DataItem as MianPageManage;
            int id = 3;
            if (rptPostTity != null)
            {
               
                rptPostTity.DataSource = mian.GetTityName(id
             );
                rptPostTity.DataBind();
            }
        }


要怎么样才能获取到 Label  里的ID值啊?Label  的ID的值是表一的
搜索更多相关主题的帖子: asp 前台 server border 
2012-09-28 15:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-382268-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.144869 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved