2009-09-18 21 views
0

我在母版頁中有一個用戶控件。在IE7(或IE8兼容模式)中查看時,它將在ContentPlaceHolders的頁面內容後面呈現。我嘗試手動設置每個元素的z-index,並且它們都不會將控件放在前面。有人遇到過這種情況麼?它適用於Chrome,Firefox,Safari和IE8不兼容。在IE7中查看時,母版頁上的ASP.NET用戶控件呈現在我的主內容後面

我在我的母版頁中將我的文檔類型更改爲以下內容,正如其他地方所建議的那樣,但沒用。

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

從母版頁:

<%@ Register Src="controls/UserInfo.ascx" TagName="UserInfo" TagPrefix="uc1" %> 

<div class="head-links"> 
       <uc1:UserInfo ID="UserInfo1" runat="server" /> 
</div> 

從用戶控制:

<asp:Panel ID="pnlPopup" runat="server" CssClass="modalPopup" Width="233px" style="z-index: 1000" > 

    <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" style="z-index:99"> 
     <asp:Button ID="OkButton" runat="server" Text="Ok" /> 
     <asp:Button ID="CancelButton" runat="server" Text="Cancel" /> 
    </div> 
    </asp:Panel> 

而CSS:

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

} 

.head-links 
{ 
position: absolute; 
top: 0px; 
right: 70px; 
text-align: left; 

width: 170px; 
} 
.head-links a 
{ 
color: #fff; 
text-decoration: underline; 
} 
.head-links a:hover 
{ 
color: #fff; 
text-decoration: none; 
} 

回答

1

你有一個樣品在那裏我們可以看一下嗎?我知道你昨天問過這個問題,我們能打的樣品會幫助一噸。

另一個想法是在您的母版頁上的窗體開始處添加一個ContentPlaceHolder。如果你的問題與dom中的彈出窗口的位置有關,那麼這可以幫助把這部分拉出來。

+0

不幸的是,這不是登錄後面的東西。一個樣本真的太長,不能在這裏發佈。 從昨天開始,我意識到它與我試圖使用的AjaxControlToolkit或ModalPopupExtender無關。如果我只是將asp:面板放在我的用戶控件中,我無法在我的主頁內容前面找到它。 – fr0man 2009-09-18 19:03:48

相關問題