AjaxControlToolkit の ModalPopupExtender を Firefox、Chrome、IE8 で正しく動作させていますが、IE8 互換モードで実行すると、ページのコンテンツの上ではなく後ろにポップアップします。
ポップアップは、Masterpage によってレンダリングされるユーザー コントロールにあります。マスター ページのコンテンツ (ヘッダーとサイドバー) がグレー表示されているため、マスター ページのコンテンツの前にポップアップが表示されますが、コンテンツのプレースホルダーはポップアップの前にレンダリングされます。マスターページの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;
}