Can anyone help how to use event from Html.Kendo()

2019-08-09 11:13发布

I am new to Kendo. Iam using Html.Kendo().CheckBoxFor(m => m.Enable) in MVC cshtml. Unable to add event change for this checkbox. I used Html.Kendo().DropDownListFor which has .Events(e => e.Change("PopulateCountry")) But I dont see same type of event in CheckBox. can anyone help on this

1条回答
Emotional °昔
2楼-- · 2019-08-09 11:33

The Html.Kendo().CheckBoxFor helper renders a regular html5 checkbox. It is not actually a kendo widget like Html.Kendo().DropDownListFor creates. I believe this is why the helper for CheckBox is lacking an .Events option.

Regardless, you can use the .HtmlAttributes option to add a change handler to the checkbox element instead:

.HtmlAttributes(new { onchange = "PopulateCountry();" })
查看更多
登录 后发表回答