我正在使用引導程序來摺疊並展開表,這是工作正常,但我使用類而不是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