简体   繁体   English

如何在Telerik的RadListBox OnClientSelectedIndexChanged事件中传递参数?

[英]How do you pass an argument in Telerik's RadListBox OnClientSelectedIndexChanged event?

How do you pass an argument in Telerik's RadListBox OnClientSelectedIndexChanged event? 如何在Telerik的RadListBox OnClientSelectedIndexChanged事件中传递参数? It seems the method you call with this event is 看来您通过此事件调用的方法是

<script type="text/javascript">
someMethod(sender, eventArgs) 
{
 var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
 if (ajaxManager != null)
     ajaxManager.ajaxRequest("ListBoxIndexChanged"); //I would like my custom argument here
}
</script>

and from the control, I call it as 从控件中,我称其为

<telerik:RadListBox ID="radListBox0" runat="server" 
OnClientSelectedIndexChanged="someMethod" />

If I try to have someMethod with a different signature, the page just doesn't work... 如果我尝试使用具有不同签名的someMethod,则该页面将无法正常工作...

The signature of the OnClientSelectedIndexChanged method cannot be changed - it receives the listbox client object as first argument and specific for the event event args as second. OnClientSelectedIndexChanged方法的签名无法更改-它接收列表框客户端对象作为第一个参数,并且特定于事件事件args作为第二个参数。 If you use global js variable or other custom storage for the parameter(s), you should be able to fetch its value in the client handler. 如果对参数使用全局js变量或其他自定义存储,则应该能够在客户端处理程序中获取其值。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 选中项目后,Telerik radlistbox会同时触发OnClientItemChecked和OnClientSelectedIndexChanged - Telerik radlistbox fires both OnClientItemChecked and OnClientSelectedIndexChanged when an item is checked Telerik RADListBox with CheckBox - 如何触发复选框中的选中项以调用其 RADListBox SelectedValue 事件 - Telerik RADListBox with CheckBox - How to trigger a checked item in checkbox to call its RADListBox SelectedValue event 如何在Telerik的radlistbox中添加标题(如组标题) - How to add title (like group header) in the telerik's radlistbox Telerik RadListBox项目列表如何隐藏字符长度并显示工具提示? - Telerik RadListBox Item list how to hide character length and show tooltip? Telerik radlistbox数据密钥无法传输 - Telerik radlistbox datakey does not transfer Telerik RadListBox不想拖动 - Telerik RadListBox dont want to drag 如何将泛型委托参数传递给.NET 2.0中的方法 - How do you pass a generic delegate argument to a method in .NET 2.0 如何在母版页后面的代码中访问Telerik RadEditor控件(嵌入在“内容”页中)? - How do you access Telerik RadEditor control (embedded in Content page) in master page's code behind? Silverlight Telerik RadListBox拖放不起作用 - Silverlight Telerik RadListBox Drag and Drop not working 当事件处理程序是委托并且不包含该参数时,如何将参数传递给事件处理程序? - How do I pass an argument to an event handler when the event handler is a delegate and doesn't include that argument?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM