asp.net-mvc - DropDownList 在 Firefox 中自动关闭

标签 asp.net-mvc firefox

我在 ASP.Net MVC 中有多个表单。

我注意到一些下拉菜单在 FireFox 中会自动关闭,但在 IE 中不会。

我没有任何 Javascript 或 JQuery 在任何这些下拉菜单上触发操作。

关于为什么会发生这种情况有什么想法吗?

<form action="Index" id="MyID" method="get"><label>
Search&nbsp;&nbsp; <input id="searchWord" name="searchWord" type="text" value="" />
&nbsp; &nbsp;Category <select id="CategoryID" name="CategoryID"><option value="">-- Select All --</option>
<option value="1">Item A</option>
<option value="2">Item B</option>
<option value="3">Item C</option>
<option value="4">Item D</option>
<option value="5">Item E</option>
</select>
</label>
<label>
<input class="button" value="Search" type="submit" />
</label>
</form>

下拉列表使用 Razor 编码为:

@Html.DropDownList("CategoryID", "-- Select All --")

最佳答案

<label> tag 定义一个标签。您的 <label> 的结束标签错误.

关于asp.net-mvc - DropDownList 在 Firefox 中自动关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9154609/

相关文章:

asp.net-mvc - 如何将输入字段绑定(bind)到模型 MVC 的编辑

javascript - 火狐3 : Enable AJAX to localhost from outside domain

javascript - 仅适用于 Firefox "Loading failed for the &lt;script&gt; with source"

java - 在 Java 中读取 HTML 时遇到问题

c# - ASP .NET Web API 返回 JSON 文件

asp.net-mvc - 我可以将 Knockout ObservableArray 作为参数传递给 ASP.NET MVC Razor @Url.Action

javascript - 使用 Javascript 从 html 表中动态删除行

javascript - 为什么从 Firefox 附加组件读取时 CSSRule 为空?

html - 图像映射/定位 anchor 位于定位图像之上(Firefox 问题)

c# - 无法添加 Controller