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的值是表一的