任何人都可以帮助如何使用Html.Kendo().CheckBoxFor(m => m.Enable)中的事件 [英] Can anyone help how to use event from Html.Kendo().CheckBoxFor(m => m.Enable)

查看:228
本文介绍了任何人都可以帮助如何使用Html.Kendo().CheckBoxFor(m => m.Enable)中的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是剑道新手.我在MVC cshtml中使用Html.Kendo().CheckBoxFor(m => m.Enable),但无法为此复选框添加更改事件. Html.Kendo().DropDownListFor具有.Events(e => e.Change("PopulateCountry")),但是我没有在CheckBox中看到相同类型的事件.

I am new to Kendo. I am using Html.Kendo().CheckBoxFor(m => m.Enable) in MVC cshtml, and I'm unable to add a change event for this checkbox. The Html.Kendo().DropDownListFor has .Events(e => e.Change("PopulateCountry")), but I dont see same type of event in CheckBox.

任何人都可以帮忙吗?

推荐答案

Html.Kendo().CheckBoxFor帮助器呈现一个常规的html5复选框.它实际上不是像Html.Kendo().DropDownListFor创建的kendo小部件.我相信这就是为什么CheckBox的帮助程序缺少.Events选项的原因.

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.

无论如何,您都可以使用.HtmlAttributes选项将更改处理程序添加到复选框元素:

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

.HtmlAttributes(new { onchange = "PopulateCountry();" })

这篇关于任何人都可以帮助如何使用Html.Kendo().CheckBoxFor(m => m.Enable)中的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆