Autocomplete dropdown using asp.net mvc

I have a dropdown in my CreateDocumentTemplate ciew
<%=Html.DropDownList("Part", (SelectList)ViewData["Part"])%>
that populates from the database. I want this dropdown menu to be autocomplete. How can i do this?

+3
source share
3 answers

Use, for example, jQueryUI (even comes bundled with MVC 3)

http://jqueryui.com/demos/autocomplete/#combobox

+7
source

I wrote an Asp.Net WebControl wrapping a jQuery UI autocomplete widget.

You can find it and related documentation at:

http://autocompletedotnet.codeplex.com/

Hope this helps

0
source

, MVC, Razor, Shield .

:

@(Html.ShieldComboBox()
    .Name("widget")
    .HtmlAttribute("value", "Chart")
    .DataSource(ds => ds.Remote(remote => remote.Read("/api/demo-stats"))
        .Schema(schema => schema.Data("components"))
        .FilterGroup(
            Shield.Mvc.UI.DataSource.FilterCondition.And,
            new object[] {
                new Dictionary<string, object>() {
                    {"path", "name"}, 
                    {"filter", "contains"},
                    {"value", ""}
                }
            }))
    .TextTemplate("{name}")
    .ValueTemplate("{name}")
    .AutoComplete(ac => ac.Enabled(true)))
0
source

Source: https://habr.com/ru/post/1785871/


All Articles