function onclick() {
var ddlobj = $("#teamList").data("ejDropDownList");
alert(ddlobj.getSelectedValue())
} |
<ejs-dropdownlist id="icons" ejs-for="SelectedIcon.Name" placeholder="Select an icon" filterBarPlaceholder="Search..." allowFiltering="true"
filtering="onFiltering" dataSource="@Model.Icons" popupHeight="300px">
<e-dropdownlist-fields text="Name" value="Name" iconCss="Name" id="Name"></e-dropdownlist-fields>
</ejs-dropdownlist> |
[HttpPost]
public async Task<IActionResult> OnPostAsync(Icon SelectedIcon)
{
if (!ModelState.IsValid)
{
return Page();
}
// Access the selected value here
string selected = SelectedIcon.Name;
return Page();
} |