There is a way to pass a custom parameter to the WebService method, in order to provide additional data when using the Load On Demand
feature. Please refer to the following instructions:
- Attach a handler to the client event OnClientItemsRequesting and implement it as demonstrated below:
function OnClientItemsRequesting(oRotator, args)
- Then you can get the value in the WebService as shown in the following code sample:
Please note that the name of the argument should be kept the same, in order to ensure proper functionality.
The scope of the items in the online demo Load On Demand
is determined by the current item index, which is automatically passed to the itemIndex
attribute of the WebService method, and a private variable itemCount
, which is set with value 5 (the number of loaded items per request). You can check the exact setup in the local version of the online demos that can be found in the installation folder of the RadControls for ASP.NET AJAX (the path for the specific demo is \Live Demos\Rotator\Examples\LoadOnDemand
Since the RadRotator's items that are loaded via WebService are inserted after the already present ones, changing the direction of the rotation will most probably cause unexpected behavior. It is recommended that a RadRotator, utilizing the Load On Demand functionality, is being scrolled only in one direction, as demonstrated in the demo.
I hope the provided information helps.
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed