[Originally posted by]: http://stackoverflow.com/questions/13405130/mvc-razor-editable-dropdownlist

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.

shareedit

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.

shareedit
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s