来自 Telerik RAD Controls 的 JavaScript
所以我想在单击 Telerik 控件时调用 JavaScript 函数。
<telerik:RadDatePicker Width="110" ID="rdpFromDate" runat="server" AutoPostBack="false" OnSelectedDateChanged="JSFunction();">
谁能告诉我哪里错了?
So I want to call a javascript function when I click on a telerik control.
<telerik:RadDatePicker Width="110" ID="rdpFromDate" runat="server" AutoPostBack="false" OnSelectedDateChanged="JSFunction();">
Can anyone tell me where I'm going wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
OnSelectedDateChanged 是一个服务器端事件,该事件在回发发生后触发,而不是在客户端发生。所以这个属性需要一个 .Net 函数而不是 JavaScript 函数。
您应该能够使用 ClientEvent 节点来注册客户端事件侦听器,请参阅 http:// /www.telerik.com/help/aspnet-ajax/calendar_pickerdisplayingthepopup.html 和 http://www.telerik.com/help/aspnet/calendar/radcalendar-telerik.webcontrols.base.calendar.clientside.calendarclientevents_members.html
OnSelectedDateChanged is a server side event, this fires after a postback has occured not on the client side. So this property is expecting a .Net function not a JavaScript function.
You should be able to use the ClientEvent Node to register client event listeners see http://www.telerik.com/help/aspnet-ajax/calendar_pickerdisplayingthepopup.html and http://www.telerik.com/help/aspnet/calendar/radcalendar-telerik.webcontrols.base.calendar.clientside.calendarclientevents_members.html
从 Telerik 文档中查看:http://www.telerik.com/帮助/aspnet-ajax/calendar_clientsideondateclick.html
Check this out from the Telerik Docs: http://www.telerik.com/help/aspnet-ajax/calendar_clientsideondateclick.html
Telerik 拥有自己的客户端 API 和所有控件的事件。
http://telerik.com/help/aspnet-ajax/calendar_clientsideevents.html
Telerik has their own client side API and events for all their controls.
http://telerik.com/help/aspnet-ajax/calendar_clientsideevents.html