RadRotator display image load on demande from a database without using webservice

2 posts, 0 answers
  1. Berrabah
    Berrabah avatar
    37 posts
    Member since:
    Feb 2012

    Posted 15 Mar 2012 Link to this post

    I would like to make an ImageRotator that display a picturs existe in a sqlserver database without using a webservice, how can i do it step by step please  ?

  2. Slav
    Slav avatar
    1351 posts

    Posted 19 Mar 2012 Link to this post

    Hi Berrabah,

    In case you don't want to use a WebService, I would suggest utilizing the control's client-side method addRotatorItem, which will allow you to dynamically create and add  new items to the RadRotator's client-side item collection. The example below demonstrates how to utilize the mentioned method in order to add a new item at the end of the collection:
    var rotator = $find("<%=RadRotator1.ClientID %>");
    var radRotatorItemData = [];
    radRotatorItemData.Html = "<div>Item's content</div>";

    You can use the RadRotator's client events OnClientItemShowing and OnClientItemShown to implement the loading of the new items at the desired moment during the sliding of the control.

    If your scenario includes removing the items of the RadRotator on the client, the removeRotatorItem (deletes a particular item) or clearItems (deletes all items) function will help you achieve this.

    Note that in the examples above I have referenced a rotator control with ID, set to RadRotator1, which may be different in your case.

    Reviewing the online demo Rotator / Client-side Items Management is also recommended, as it shows in action the methods, described above.

    I hope the provided information will help you incorporate the desired feature into your actual project.

    Kind regards,
    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 now.
  3. DevCraft R3 2016 release webinar banner
Back to Top