RadRotator for ASP.NET AJAX

RadControls for ASP.NET AJAX

The RadRotator supports Load On Demand functionality through a WebService. To enable this feature you should create a WebService that will control the displaying items and attach it to the RadRotator control. The inner property WebServiceSettings of the RadRotator has two properties for this purpose:

  • Path - sets the location of the WebService file;

  • Method - sets the WebService method that implements the RadRotator logic for displaying the items;

Since the RadRotator functionality is entirely controlled by the WebMethod, you can also return different number of items on each request.

Below you can find an example of the setup that is used with enabled Load on Demand:

CopyASPX
<telerik:RadRotator ID="RadRotator1" runat="server" Width="220px" Height="135px"
   ItemHeight="135" ItemWidth="110" CssClass="positionCenter" ScrollDuration="500" >
   <WebServiceSettings Path="RotatorWebService.asmx" Method="GetRotatorData" />
</telerik:RadRotator>

The attached WebService should have the following signature:

The HTML, which should be rendered in the item, is assigned to the Html property of the RadRotatorItemData object.

There is an option for passing an argument to the WebService method. This can be achieved via the RadRotator’s client event OnClientItemsRequesting. The argument is sent in the handler of this event, as demonstrated below:

CopyASPX
<script type="text/javascript">
    function OnClientItemsRequesting(sender, args) {
        args.set_argument("Item");
    }
</script>

The passed argument can be accessed through the argument parameter of the WebService method.

There are three client events that are related to the Load On Demand functionality: