Repeater里面嵌套了一个子Repeater,我要获取子Repeater模板里面的值
<asp:RepeaterID="repList"runat="server"onitemdatabound="repList_ItemDataBound"><ItemT...
<asp:Repeater ID="repList" runat="server" onitemdatabound="repList_ItemDataBound">
<ItemTemplate>
<label style="margin:0;"><input type="checkbox" class="cball" onclick="SelectedItems(this, '<%#Eval("Name") %>');" /><b><%#Eval("Title") %></b></label>
<asp:Repeater ID="repList2" runat="server">
<ItemTemplate>
<asp:HiddenField ID="hidId" Value='<%# DataBinder.Eval((Container.Parent.Parent as RepeaterItem).DataItem, "Id") %>' runat="server" />
<asp:HiddenField ID="hidName" Value='<%# DataBinder.Eval((Container.Parent.Parent as RepeaterItem).DataItem, "Name") %>' runat="server" />
<label><input type="checkbox" runat="server" id="hidViewName" value='Add' class='<%# DataBinder.Eval((Container.Parent.Parent as RepeaterItem).DataItem, "Name") %>' /><%# Eval("Name") %></label>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
在后台里面获取循环获取 HiddenField 里面的值 展开
<ItemTemplate>
<label style="margin:0;"><input type="checkbox" class="cball" onclick="SelectedItems(this, '<%#Eval("Name") %>');" /><b><%#Eval("Title") %></b></label>
<asp:Repeater ID="repList2" runat="server">
<ItemTemplate>
<asp:HiddenField ID="hidId" Value='<%# DataBinder.Eval((Container.Parent.Parent as RepeaterItem).DataItem, "Id") %>' runat="server" />
<asp:HiddenField ID="hidName" Value='<%# DataBinder.Eval((Container.Parent.Parent as RepeaterItem).DataItem, "Name") %>' runat="server" />
<label><input type="checkbox" runat="server" id="hidViewName" value='Add' class='<%# DataBinder.Eval((Container.Parent.Parent as RepeaterItem).DataItem, "Name") %>' /><%# Eval("Name") %></label>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
在后台里面获取循环获取 HiddenField 里面的值 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询