ASP .NET - CollapsiblePanelExtender 在 IE7 中不起作用
我正在运行 ASP .NET AJAX 工具包 3.5。
我已经设置了一个带有 collapsablePanelExtender 的面板,它可以在 Firefox 3.5 中工作,但不能在 IE7 中工作!在 IE7 中,所有“折叠”面板都不会缩小 - 激活按钮不会执行任何操作。
我的代码:
<asp:ImageButton ID="btnA" runat="server" ImageUrl="~/Image/expand.gif" />
<asp:Panel ID="pnlA" runat="server" >
<!-- grid -->
<asp:GridView ID="gridA" runat="server"
AllowPaging="True" AllowSorting="True"
DataSourceID="sdsA" GridLines="Vertical">
</asp:GridView>
</asp:Panel>
<cc1:CollapsiblePanelExtender ID="cpeA" runat="server"
Enabled="True" TargetControlID="pnlA"
CollapsedSize="0" ExpandedSize="300" Collapsed="true" ScrollContents="true"
ExpandControlID="btnA" CollapseControlID="btnA"
ExpandDirection="Vertical" ExpandedImage="~/Image/collapse.gif"
CollapsedImage="~/Image/expand.gif"
ImageControlID="btnA" AutoExpand="false" SuppressPostBack="true">
</cc1:CollapsiblePanelExtender>
代码有问题吗?
我一直在使用的 DOCTYPE 是:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
我也尝试过:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
UPDATE1:
看起来好像单击按钮会导致面板“隐藏”一小会儿,然后再重新出现。
I am running the ASP .NET AJAX Toolkit 3.5.
I have setup a panel with a collapsablePanelExtender and it works in Firefox 3.5 but not in IE7! In IE7 all the "collapsed" panels never shrink - activating the button does nothing.
My code:
<asp:ImageButton ID="btnA" runat="server" ImageUrl="~/Image/expand.gif" />
<asp:Panel ID="pnlA" runat="server" >
<!-- grid -->
<asp:GridView ID="gridA" runat="server"
AllowPaging="True" AllowSorting="True"
DataSourceID="sdsA" GridLines="Vertical">
</asp:GridView>
</asp:Panel>
<cc1:CollapsiblePanelExtender ID="cpeA" runat="server"
Enabled="True" TargetControlID="pnlA"
CollapsedSize="0" ExpandedSize="300" Collapsed="true" ScrollContents="true"
ExpandControlID="btnA" CollapseControlID="btnA"
ExpandDirection="Vertical" ExpandedImage="~/Image/collapse.gif"
CollapsedImage="~/Image/expand.gif"
ImageControlID="btnA" AutoExpand="false" SuppressPostBack="true">
</cc1:CollapsiblePanelExtender>
Is there something wrong with the code?
The DOCTYPE I have been using is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I also tried:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" >
UPDATE1:
It looks as though clicking on the button resulting in the panel 'hiding' for a brief moment before it re-appears.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我刚刚检查了 IE8、Firefox 和 Chrome 中的代码,它似乎适用于所有这些。只需在 IE8 上查看一下,然后告诉我它是否有效。
要么是IE7设置有问题,要么是浏览器本身有问题。代码就好了。
I just checked the code in IE8, Firefox and Chrome and it seems to be working with all of them. Just check it out on IE8, and let me know if it works.
Either IE7 settings, or the browser itself is at fault. Code is just fine.
如果其他人遇到这种情况,我将提供额外的答案:
一个可能的替代方案是使用手风琴控件。这在 IE7 中运行良好。
I'll provide an additional answer in case anyone else encounters this:
A possible alternative is to use the accordion control. This works well in IE7.