我正在使用引导程序来折叠并展开表,这是工作正常,但我使用类而不是ID。这样,扩展一行就可以扩展所有的行,而不仅仅是那一行。我的问题是我的数据目标如何指向嵌套的中继器ID? transactionCollapse ID无法直接定位,我试过做<%=transactionGroupedList.FindControl("transactionCollapse")%>
,但它抛出了一个错误。ASP嵌套中继器ID
<tbody>
<asp:Repeater runat="server" ID="transactionGroupedList" OnItemDataBound="TransactionGroupedDataList_ItemDataBound">
<ItemTemplate>
<tr>
<!-- This line should target the transactionCollapse ID below instead of the class -->
<td data-toggle="collapse" data-target=".transactionCollapse">
<span id="transactionGroupCollapseIcon" runat="server" class="fonticon-down-arrow"></span>
<custom:Label runat="server" ID="transactionActivityDataColumnLabel"></custom:Label>
</td>
<td>
<custom:Label runat="server" ID="transactionDateDataColumnLabel">
</custom:Label>
</td>
<td>
<custom:Label runat="server" ID="transactionNumberDataColumnLabel">
</custom:Label>
</td>
<td>
<custom:Label runat="server" ID="transactionAmountDataColumnLabel">
</custom:Label>
</td>
<td>
<custom:Label runat="server" ID="transactionStatusDataColumnLabel">
</custom:Label>
</td>
</tr>
<asp:Repeater runat="server" ID="transactionDetailList" OnItemDataBound="TransactionDetailsDataList_ItemDataBound">
<ItemTemplate>
<tr id="transactionCollapse" runat="server" class="collapse transactionCollapse">
<td colspan="2">
<custom:Label runat="server" ID="transactionDetail">
</custom:Label>
</td>
<td>
<custom:Label runat="server" ID="transactionDetailTransactionNumber">
</custom:Label>
</td>
<td>
<custom:Label runat="server" ID="transactionDetailAmount">
</custom:Label>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
</tbody>
的Online Payment
行就是折叠/展开下面的Posting -
和MP Payment
行。此用户只有一个Online Payment
,但许多用户将拥有多个。
你能根据呈现的输出创建[JSFiddler](https://jsfiddle.net/)吗? – Win