ASP下拉列表未在IE 9中显示

时间:2016-11-18 16:44:48

标签: html asp.net internet-explorer c#-2.0

我正在处理现有的ASP.NET代码,并尝试添加一个包含3个下拉列表的对话框。在IE中进行调试时,它们可以在我的机器上工作,甚至当我将IE模拟模式更改为9时,它们会显示在我的机器上,但是当在测试服务器上的IE 9中运行时,下拉列表根本不可见。加载页面或单击按钮以显示对话框时,控制台中没有Javascript错误,并且DOM资源管理器显示表格行数据的标签位于其中,因此我不确定这里出了什么问题。

这是对话框'标记:

<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

1 个答案:

答案 0 :(得分:0)

想出来。我不确定它与IE版本有什么关系,因为我不是那么精通IE浏览器的知识,而是删除&#34;宽度:100%&#34;来自&#34; asp:DropDownList runat =&#34; server&#34; ID =&#34; selSpareAssemblyID&#34;&#34;使选择显示出来。我想发生的事情是表行的宽度设置为0px或类似的东西,但移动&#34;宽度:100&#34;到桌子让他们出现。有人可能会详细了解为什么会发生这种情况,但这就是我修复它的方法。