[英]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.