mvc razor editable DropDownList

一个人想着一个人 提交于 2020-01-11 10:22:40

问题


I am looking for a code to make the dropdown list editable in MVC razor. @Html.DropDownList provides the standard select list, but the values are not editable.

I tried an example from a tutorial, but it does not seem to work.


回答1:


First need to add the script reference to the page:

<script type="text/javascript" src="jquery.editable-select.pack.js"></script>

This If you host this script on your server.

You only need to set the id on you razor definition of the dropdown and then do this:

$('#nameOfDropDown').editableSelect({...});

After doing this and checking the documentation of this plugin you might be able to get a editable select list.



来源:https://stackoverflow.com/questions/13405130/mvc-razor-editable-dropdownlist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!