Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找使下拉列表在 MVC razor 中可编辑的代码。@Html.DropDownList 提供标准选择列表,但值不可编辑。
我尝试了一个教程中的示例,但它似乎不起作用。
首先需要在页面中添加脚本引用:
<script type="text/javascript" src="jquery.editable-select.pack.js"></script>
如果您在服务器上托管此脚本。
您只需要在下拉列表的剃刀定义上设置 id,然后执行以下操作:
$('#nameOfDropDown').editableSelect({...});
完成此操作并检查此插件的文档后,您可能可以获得可编辑的选择列表。