ASP.NET Pack Programmer's Guide
Slideshow

The Slideshow control provides the ability to display a set of images as a slideshow. It represents a container of SlideshowItem objects, each of which can have a designated image, thumbnail, title and navigate URL.

Server side

Customizing the control

You can define the individual items displayed by the control by creating SlideshowItem objects and adding them to the control's Items collection, or by using one of the overloads of the AddItem method. Alternatively, a list of image URL-s to read from can be assigned to the ImageSource property.

The control's thumbnails size and position can be customized through the ThumbnailsWidth, ThumbnailsHeight and ThumbnailsPlacement properties. You can choose whether to display navigation buttons and item titles by setting the ShowButtons and TitlePosition properties.

The speed of the slideshow, as well as the speed of images' transition can be adjusted by using the SlideshowSpeed and TransitionSpeed properties.

Events

The following events are exposed by the Slideshow class.

Event

Event arguments

Description

Click

EventArgs

Raised when an item's image is clicked.

Client side

Getting a reference to the control

You can access the control on the client side by its ClientID.

JavaScript  Copy Code

var slideshow = $find("Slideshow1");
var slideshow = $find("<%= Slideshow1.ClientID %>");

Getting and setting the selected item index

Use the get_selectedIndex and set_selectedIndex  methods to get or set the control's selected item index.

JavaScript  Copy Code

slideshow.set_selectedIndex(2);
alert(slideshow.get_items()[slideshow.get_selectedIndex()].title);

Starting and stopping the slideshow

Use the start and stop methods to start and stop the slideshow from the client-side.

Events

The following client-side event are exposed by the Slideshow class.

Event

Event arguments

Script property

Description

itemClicked

ItemEventArgs

ItemClickedScript

Raised when an item's image is clicked.

selectedIndexChanged

ValueChangingEventArgs

SelectedIndexChangedScript

Raised when a control's selected image index has changed.

controlLoaded

-

ControlLoadedScript

Raised just after the control has finished loading and is ready for interaction.