This is a migrated thread and some comments may be shown as answers.

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

1 Answer 63 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Berrabah
Top achievements
Rank 1
Berrabah asked on 15 Mar 2012, 11:41 AM
Hello,
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  ?
Thankx

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 19 Mar 2012, 03:59 PM
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>";
rotator.addRotatorItem(radRotatorItemData);

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,
Slav
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.
Tags
Rotator
Asked by
Berrabah
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or