【发布时间】:2017-04-02 14:30:14
【问题描述】:
我正在处理现有的 ASP.NET 代码,并尝试添加一个带有 3 个下拉菜单的对话框。它们在 IE 中调试时在我的机器上工作,即使我将 IE 模拟模式更改为 9,它们也会出现在我的机器上,但是当在测试服务器上的 IE 9 中运行时,下拉菜单根本不可见。加载页面或单击按钮以显示对话框时,控制台中没有 Javascript 错误,并且 DOM Explorer 显示表格行数据有标签,里面有选项,所以我不确定是什么这里出错了。
这是对话框的标记:
<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>
<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> </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> </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 下拉菜单不可见:
我的机器(在模拟 V9 的 IE 中调试)可见:
【问题讨论】:
-
这可能是您的测试服务器上的数据问题,下拉列表中没有加载数据显示,您是否在其他浏览器上尝试过?
-
width(和其他表示形式)属性在 html4 中已被贬值......它们也以像素而不是 % 为单位。一些弓箭手会使用 % 。使用开发工具的 DOM 资源管理器选项卡突出显示在调试演示文稿时显示为“隐藏”的元素。
标签: html asp.net internet-explorer c#-2.0