views:

105

answers:

1

How do you pass an argument in Telerik's RadListBox OnClientSelectedIndexChanged event? 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...

+1  A: 

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. 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.

Dick Lampard