【问题标题】:Modal popup appears behind modal background in Ajax Control Toolkit模态弹出窗口出现在 Ajax Control Toolkit 中模态背景的后面
【发布时间】: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 设置得较低,但没有成功。

问题:

  1. 以前有人遇到过这个问题吗?如果是这样,你能指出我正确的方向吗?
  2. 如果您没有遇到此问题,您会查看哪些内容?我完全没有想法

【问题讨论】:

  • 您可以下载 AjaxToolKit 的代码并找到为 ModalPopupExtender 设置 z-index 的位置并增加该值。然后编译你自己的dll并使用它。当我无法覆盖嵌入资源的样式时,我不得不这样做。

标签: asp.net internet-explorer ajaxcontroltoolkit modal-dialog


【解决方案1】:

尝试更改属性

位置:固定;到位置:绝对;

【讨论】:

  • 我刚刚检查过了,感谢您的尝试,但它并没有解决问题:(
  • 试一试。尝试设置 display:inline;
【解决方案2】:

事实证明,问题不在我发布的任何内容中。问题出在我们的模板中,可能是标签未关闭。

【讨论】:

    【解决方案3】:

    设置面板背景颜色(BackColor="White");它会解决你的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-18
      • 2017-08-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多