Feedback Form

Friday, February 01, 2008

SlideShowExtender on slide change

How to add an onchange event to the SlideShowExtender?

-After adding your SlideShowExtender, assign the image control to it and setting a BehaviorID

<cc1:SlideShowExtender BehaviorID="behaviorID" ID="SlideShowExtender1" runat="server" SlideShowServiceMethod="GetSlides" PlayInterval="5000" TargetControlID="imgScreen"  UseContextKey="True" AutoPlay="true" Loop="true"></cc1:SlideShowExtender>

-Add the following java script code inside your html code file:

<script language="javascript" type="text/javascript">  
    function pageLoad(){ 
        var slider1;  
        slider1 = $find("behaviorID"); 
        slider1.add_slideChanging(onSlideChanging);  
    }
     function onSlideChanging(sender, args){ 
        currentSlideIndex = args.get_slideIndex();  
        //Do what you want using this index
     }
</script>



kick it on DotNetKicks.com

5 comments:

Anonymous said...

Thanks for this info, I am new to asp.net and to oop in general. How would I go about adding a fade effect to the slides when they change?

Amr ElGarhy said...

here is a good sample:
http://amrelgarhytech.blogspot.com/2008/02/slideshowextender-fade-effect.html

Anonymous said...

Thanks for the second post, it can also be found here:

http://forums.asp.net/t/1086320.aspx

Amr ElGarhy said...

Yes, i used this example in application of mine as well, its good.

Anonymous said...

Hi, is it possible to use that index and create a div on the top of the image? so that the div consists of a link. From what I know, it doesn't work with imagemap.