'Vue on change on Html.DropDownList MVC 5
here is my dropdownlist
@Html.DropDownList("UAPs", (IEnumerable<SelectListItem>)ViewData["UAPs"], new { @class = "form-control form-contro-sm", @id = "uap", @v_model = "uap" })
I'm already binding the selected value, however, i need to create an event for on change to trigger ajax call to refresh the table for filtering data but i can't seem to manage to bind it
@v_on:change = ""
this does not work
Solution 1:[1]
I solved this problem using variables.
@{
var attribs = new Dictionary<string, object>();
attribs.Add("class", "form-control form-contro-sm");
attribs.Add("id", "uap");
attribs.Add("v-model", "uap");
attribs.Add("v-on:change", "myFunction()");
}
@Html.DropDownList("UAPs", (IEnumerable<SelectListItem>)ViewData["UAPs"], htmlAttributes: attribs)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dharman |
