【发布时间】:2012-06-27 18:26:40
【问题描述】:
问题:
在 IE8 下,Ajax 控件工具包的弹出面板位于 modalBackground 下方(参见屏幕截图)。这只发生在 IE8 中。
以前的尝试:
我尝试在 css 文件中覆盖 z-index(看起来像 z-index 问题):
.modalPopup
{
background-color: white;
width:200px;
height:150px;
z-index:100000001 !important;
}
问题依然存在。在 Firefox 中使用 firebug,当用户单击按钮以显示模式弹出窗口时,我可以检查 z-index 的变化,并且 z-index 会正确更改。
代码:
<asp:ModalPopupExtender ID="MPsdE" runat="server" Enabled="true" DynamicServicePath=""
OkControlID="OkButton"
CancelControlID="CancelButton"
TargetControlID="MoreServers"
PopupControlID="ModalPanel"
BackgroundCssClass="modalBackground" >
</asp:ModalPopupExtender>
<asp:Panel ID="ModalPanel" runat="server" >
<div class="modalPopup" >
test <asp:Button ID="OkButton" runat="server" Text="Okay"/>
<asp:Button ID="CancelButton" runat="server" Text="Cancel"/>
</div>
</asp:Panel>
CSS:
.modalBackground
{
position:fixed;
background-color:#000;
filter:alpha(opacity=50);
opacity:0.5;
}
.modalPopup
{
background-color: white;
width:200px;
height:150px;
z-index:100000001 !important;
}
我也尝试将 modalBackground 的 z-index 设置得较低,但没有成功。
问题:
- 以前有人遇到过这个问题吗?如果是这样,你能指出我正确的方向吗?
- 如果您没有遇到此问题,您会查看哪些内容?我完全没有想法
【问题讨论】:
-
您可以下载 AjaxToolKit 的代码并找到为 ModalPopupExtender 设置 z-index 的位置并增加该值。然后编译你自己的dll并使用它。当我无法覆盖嵌入资源的样式时,我不得不这样做。
标签: asp.net internet-explorer ajaxcontroltoolkit modal-dialog