asp.net - 为什么我的 ajaxCollapsiblePanel 不工作
问题描述
我的 ajaxColpsiblePanelExtender 有一些问题。当我单击按钮时,它应该隐藏第二段。
<asp:Button runat="server" ID="_btnCollpasePanel" Text="Click Here to Collapse"/>
<table>
<tr>
<td style="border: solid 1px #7f9db9; width: 200px;">
<p>Some collapsible content. Click the button to toggle between
showing and hiding the collapsible content.</p>
</td>
</tr>
<tr>
<asp:Panel runat="server" ID="sample">
<ajax:CollapsiblePanelExtender runat="server"
ID="sampleCollapsiblePanel" TargetControlID="sample"
CollapseControlID="_btnCollpasePanel"
ExpandControlID="_btnCollpasePanel" Collapsed="true">
</ajax:CollapsiblePanelExtender>
<td style="border: solid 1px #7f9db9; width: 200px;">
<p>Some collapsible content. Click the button to toggle
between showing and hiding the collapsible content.</p>
</td>
</asp:Panel>
</tr>
</table>
解决方案
由于可折叠面板位于<td>
元素之外。它不起作用。
<asp:Button runat="server" ID="_btnCollpasePanel" Text="Click Here to Collapse"/>
<table>
<tr>
<td style="border: solid 1px #7f9db9; width: 200px;">
<p>Some collapsible content. Click the button to toggle between
showing and hiding the collapsible content.</p>
</td>
</tr>
<tr>
<td style="border: solid 1px #7f9db9; width: 200px;">
<asp:Panel runat="server" ID="sample">
<ajax:CollapsiblePanelExtender runat="server"
D="sampleCollapsiblePanel" TargetControlID="sample"
CollapseControlID="_btnCollpasePanel"
ExpandControlID="_btnCollpasePanel" Collapsed="true">
</ajax:CollapsiblePanelExtender>
<p>Some collapsible content. Click the button to toggle
between showing and hiding the collapsible content.</p>
</asp:Panel>
</td>
</tr>
</table>
推荐阅读
- jquery - JQuery Load 不能与 A Href 一样工作(但与 Button 一起工作正常)
- r - I'm getting NA's applying separate() function over column of characters in R
- docker - 如何记录泊坞窗图像
- javascript - Nodejs Passport 失败消息不起作用
- flutter - 如何在类似于搜索词的地方设置字符串样式
- c++ - 了解多线程如何与 Boost io_service 一起工作
- javascript - 使用多行字符串编写漂亮的 JSON?
- highcharts - Highchart - 如何控制系列之间的差距
- c# - 在用户编辑和输入单元格时更改 DataGridView 的单元格样式
- c++ - C++字节序会影响fstream的读写功能吗?