加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 在IE7 / IE8兼容模式下,ModalPopupExtender不会呈现

发布时间:2020-12-16 03:50:52 所属栏目:asp.Net 来源:网络整理
导读:我有一个来自AjaxControlToolkit的ModalPopupExtender,可以在Firefox,Chrome和IE8中正常运行,但是当我在IE8兼容模式下运行时,它会弹出我页面的内容,而不是在顶部. 弹出窗口位于由主页面呈现的用户控件中.我认为正在发生的是它正在主页面内容中出现,因为主页
我有一个来自AjaxControlToolkit的ModalPopupExtender,可以在Firefox,Chrome和IE8中正常运行,但是当我在IE8兼容模式下运行时,它会弹出我页面的内容,而不是在顶部.
弹出窗口位于由主页面呈现的用户控件中.我认为正在发生的是它正在主页面内容中出现,因为主页内容(我的标题和侧边栏)显示为灰色,但内容占位符在我的弹出窗口前呈现.我在网上找到了一个解决方案,建议将母版页中的doctype声明更改为:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

但我已经有了确切的声明,仍然存在定位问题.这是弹出代码:

<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
    TargetControlID="lnkbtnDealerID"
    PopupControlID="pnlPopup"
    BackgroundCssClass="modalBackground"
    DropShadow="true"
    OkControlID="OkButton"
    CancelControlID="CancelButton"
    OnOkScript=""
    >
</cc1:ModalPopupExtender>

  <asp:Panel ID="pnlPopup" runat="server" CssClass="modalPopup" Style="display: none"     Width="233px">
   <p>Are you sure?  Your current shopping cart is valid only for the current Dealer ID.      Switching Dealer IDs will reset your cart according to the new Dealer ID chosen.</p>

   <br />
   <div align="center">
      <asp:Button ID="OkButton" runat="server" Text="Ok" />
      <asp:Button ID="CancelButton" runat="server" Text="Cancel" />
   </div>
   </asp:Panel>

和相关的CSS:

.popupControl {
    background-color: white;
    position:absolute;
visibility:hidden;
border-style:solid;
border-color: Black;
border-width: 2px;
}

.modalBackground {
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
}

.modalPopup {
background-color:white;
border-width:1px;
border-style:solid;
border-color:Gray;
padding:3px;
width:250px;
}

解决方法

我刚刚发现你的帖子,所以尝试解决同样的问题.对我来说,我将其追踪到一个名为mainBody的div标签,其中包含所有页面内容.控制此div的CSS类具有相对定位但没有z-index.一旦我为mainBody设置z-index为-1,我的modalPopup在IE7中完美运行.

希望这可以帮助?!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读