2013-02-19 20 views
0

我遇到了IE的問題。該頁面在所有瀏覽器中都能正常工作,如下所示。溢出:隱藏使得數據在IE中消失

enter image description here

,但在IE中的數據並不即使它有露面。

enter image description here

問題是由溢流引起的:我在ListView中的項目模板使用隱藏屬性。當我將其更改爲任何其他值時,數據會在IE中顯示,但當然佈局會在所有瀏覽器中混亂。

這裏是源代碼和CSS http://jsfiddle.net/V5aCa/8/

這裏是我的代碼:

<asp:ListView ID="BookListView" runat="server" DataSourceID="SqlDataSource1" 
    onselectedindexchanged="BookListView_SelectedIndexChanged"> 
    <LayoutTemplate> 
     <table runat="server" cellpadding="1" id="tblBooks" style=""> 
      <tr runat="server"> 
       <td runat="server"> 
        <table ID="itemPlaceholderContainer" runat="server" border="0" style=""> 
         <tr ID="itemPlaceholder" runat="server"> 
         </tr> 
        </table> 
       </td> 
      </tr> 
     </table> 
    </LayoutTemplate> 

    <ItemTemplate> 
     <div style="overflow:hidden"> 
      <div class="itemTemplateleftColumn"> 
       <asp:Image ID="Image1" runat="server" ImageUrl='<%# String.Format("~\\Static\\Images\\BookCovers\\{0}", Eval("CoverImageSmall")) %>' Height="120px" Width="90px" BorderColor="Gray" BorderWidth="1px"/> 
      </div> 
      <div class="itemTemplaterightColumn"> 
       <div class="titleRow"> 
        <asp:Label runat="server" ID="BookTitleLabel" Text='<%# Eval("Title") %>' /> 
       </div> 
       <div class="nameRow"> 
        <asp:Label runat="server" ID="FirstNameLabel" Text='<%# Eval("FirstName") %>' /> 
        <asp:Label runat="server" ID="LastNameLabel" Text='<%# Eval("LastName") %>' /> 
       </div> 
       <div class="values"> 
        <div> 
         value1 
        </div> 
        <div> 
         value2 
        </div> 
       </div>  
       <div class="values"> 
        <div> 
         value3 
        </div> 
        <div> 
         <asp:Label runat="server" ID="PriceLabel" Text='<%# Eval("Price") %>' />&#8364 
        </div> 
       </div>  
      </div> 
     </div> 
    </ItemTemplate> 

</asp:ListView> 

</asp:Content> 

我將不勝感激解決這個問題的任何幫助。提前致謝。

+0

你有一個客戶端問題。向我們展示客戶端代碼,而不是生成它的ASP。 – Quentin 2013-02-19 13:57:44

+0

@Quentin這是在小提琴http://jsfiddle.net/V5aCa/8/ – Tsarl 2013-02-19 14:15:37

+0

[我的網站上的東西不起作用。我可以只粘貼一個鏈接嗎?](http://meta.stackexchange.com/questions/125997/something-on-my-web-site-doesnt-work-can-i-just-paste-a-link對它) – Quentin 2013-02-19 14:16:26

回答

0

[更新]首先,應用css類或id以避免內聯樣式。

然後,嘗試編寫overflow:hidden !important以防止IE應用該規則,這應該有訣竅!

.your-div-class{ 
    overflow:visible; /* This is default value, but reset it anyway */ 
    overflow:hidden !important; 
} 
+0

沒有改變...隱藏是溢出的默認值,對不對? – Tsarl 2013-02-19 13:44:07

+0

@Tsarl查看已更新的答案 – Bigood 2013-02-19 13:56:43

+0

我用過這個,但是再次沒有變化#MainContent_BookListView_itemPlaceholderContainer div { overflow:visible; 溢出:隱藏!重要; } – Tsarl 2013-02-19 14:12:37

0

應用最小高度和寬度在的GridView該div,然後應用溢出 最小高度:110px;最小寬度:150像素;

試試這個希望它會有所幫助!

+0

不幸的是它不起作用。 – Tsarl 2013-02-19 15:59:13