Feedback Form

Friday, February 08, 2008

SlideShowExtender Fade effect

You can make fade effect while sliding and there is a good way by using SlideShowExtender + AnimationExtender like the following good sample:

<%@ Page Language="C#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<script runat="server">
public static AjaxControlToolkit.Slide[] GetSlides()
return new AjaxControlToolkit.Slide[] {
new AjaxControlToolkit.Slide("AjaxToolKit/SliderShowImages/Blue hills.jpg", "Blue Hills", "Go Blue"),
new AjaxControlToolkit.Slide("AjaxToolKit/SliderShowImages/Sunset.jpg", "Sunset", "Setting sun"),
new AjaxControlToolkit.Slide("AjaxToolKit/SliderShowImages/Winter.jpg", "Winter", "Wintery..."),
new AjaxControlToolkit.Slide("AjaxToolKit/SliderShowImages/Water lilies.jpg", "Water lillies", "Lillies in the water"),
new AjaxControlToolkit.Slide("AjaxToolKit/SliderShowImages/VerticalPicture.jpg", "Sedona", "Portrait style picture")};

<html xmlns="">
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript">
var fadein;
var fadeout;

function pageLoad()
var ss=$find("ss1");

var ae=$find("ae");
var be=ae.get_OnLoadBehavior();
var an=be.get_animation();

function onChanging(sender, args)
window.setTimeout("", 1000);
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptLocalization="true" EnableScriptGlobalization="true">
<asp:Image ID="Image1" runat="server"
Style="border: 1px solid black;width:auto"
AlternateText="Blue Hills image" />
<ajaxToolkit:SlideShowExtender ID="slideshowextend1" runat="server"
TargetControlID="Image1" BehaviorID="ss1"
SlideShowServiceMethod="GetSlides" PlayInterval="2000"
Loop="true" />
<ajaxToolkit:AnimationExtender id="MyExtender" runat="server" BehaviorID="ae" TargetControlID="Image1">
<FadeOut Duration="0" Fps="20" />
<FadeIn Duration="0" Fps="20" />

Download Sample


Anonymous said...

im sorry but i get javascript error

not working...

Unknown said...

this is based on this refrence,

so you can tell me the error you had , may be i can help you solve

Anonymous said...

thank you very much.It's greate
Nguyen Xuan Canh

Anonymous said...

i got a javascript error plzzzz help :"nextSlide is undefined"

Unknown said...

this example is based on this:

if you want help can you send me the example you did and had an error in, send me the page its self on my mail

Anonymous said...

why is the animation so choppy? The images spend more time blank than showing to the user

Stu said...

How do you stop the choppy speed?

Pravesh Singh said...

Very informative post. Its really helpful for me and beginner too. Check out this link too its also having a nice post with wonderful explanation on Ajax Toolkit SlideShowExtender Control in ASP.Net...
Ajax Toolkit SlideShowExtender Control in ASP.Net

Shrilekha said...

lusiI want both fade in and move effect to slide this code i am able to do fading effect...Please tell me solution of above.

Shrilekha said...

I want both fade in and move effect to slide this code i am able to do fading effect...Please tell me solution of above.