2016-11-18 60 views
0

我的工作在現有的ASP.NET代碼不顯示,我試圖添加一個對話框3個下拉菜單。在IE中調試時,它們在我的機器上工作,甚至當我將IE模擬模式更改爲9時,它們顯示在我的機器上,但是當在測試服務器上的IE 9中運行時,下拉菜單根本不可見。當頁面加載時或者單擊按鈕以顯示對話框時,控制檯中沒有Javascript錯誤,並且DOM Explorer顯示錶格行數據中帶有選項的標籤,因此我不確定是什麼這裏出錯了。ASP下拉列表中的IE 9

下面是對話標記:

<div id="boxCreateSpare" title="Create Assembly" runat="server" style="display: none;"> 
     <table> 
      <tr> 
       <td> 
        <asp:Label ID="lblSpareAssemblyID" runat="server" Font-Bold="True"></asp:Label>: 
       </td> 
       <td> 
        <asp:DropDownList runat="server" ID="selSpareAssemblyID" Width="100%"></asp:DropDownList> 
       </td> 
       <td> 
        &nbsp;<asp:Label ID="lblSpareDescription" runat="server" Font-Bold="true" Font-Size="12px" Width="120px"></asp:Label> 
       </td> 
      </tr> 
      <tr> 
       <td> 
        <asp:Label ID ="lblTireProductId" runat="server" Font-Bold="true"></asp:Label>: 
       </td> 
       <td> 
        <asp:DropDownList runat="server" ID="selTireProductId" Width="100%"></asp:DropDownList> 
       </td> 
       <td>&nbsp;</td> 
      </tr> 
      <tr> 
       <td> 
        <asp:Label ID ="lblWheelProductId" runat="server" Font-Bold="true"></asp:Label>: 
       </td> 
       <td> 
        <asp:DropDownList runat="server" ID="selWheelProductId" Width="100%"></asp:DropDownList> 
       </td> 
       <td>&nbsp;</td> 
      </tr> 
      <tr> 
       <td colspan="3" align="center" width="100%"> 
        <input type="submit" class="button" style="height: 25px; width: 150px;" id="btnSpareFinishCreate" runat="server" onclick="createSpare()" /> 
        <input type="button" class="button" style="height: 25px; width: 150px;" id="btnSpareCancel" runat="server" onclick="$('#boxCreateSpare').dialog('close');" /> 
       </td> 
      </tr> 
     </table> 
    </div> 

測試服務器IE9的下拉列表中不可見:

Test server IE9 dropdowns not visible

我的機器(在IE中模擬V9調試)可見:

My machine (debugging in IE emulating V9) visible

+0

它可能是你的測試服務器上的數據的問題,沒有在下拉列表顯示加載的數據,你有沒有嘗試在其他瀏覽器? –

+0

寬度(和其他演示文稿)屬性在html4中折舊...也是像素不是%。一些bowsers會使用%。使用開發工具的DOM資源管理器選項卡突出顯示調試演示文稿時出現「隱藏」的元素。 –

回答

0

想通了。我不知道它與IE版本有什麼關係,因爲我不是很熟悉IE知識,但從「asp:DropDownList runat =」server「ID =」中刪除「width:100%」風格selSpareAssemblyID「」使選擇顯示出來。我猜想發生了什麼事是表格行的寬度被設置爲0px或類似的東西,但將「寬度:100」移動到表格讓它們顯示出來。有人可能會更詳細地介紹爲什麼會發生這種情況,但這是我如何解決這個問題的。