Click here to Skip to main content
Click here to Skip to main content

An ASP.NET Slide Show

, 30 Mar 2006
Rate this:
Please Sign up or sign in to vote.
A simple slide show using AJAX in ASP.NET.


I had been looking for the source of a web-based slide show for my own use. The features I wanted in my slide show pages were that it should dynamically select a picture in the server to display, it should display some transition effects, and it should not cause page refreshing. But I couldn’t find one of this kind. So I decided to code it myself.

There is a lot of source code to make the transition effect using JavaScript. But to address the dynamic selection of the picture to display and to avoid the page from refreshing, I used AJAX. There are a lot of AJAX frameworks and tools out there to choose from. But for this simple task, I just used the ASP.NET2’s built-in AJAX supported class System.Web.UI.ICallbackEventHandler.

The included source code will demonstrate the use of this class, and also how to use JavaScript to make the request to get the next image file and apply the transition effects. One thing I need to mention is when applying transition effects, the next image has to be completely loaded before playing the effect, otherwise, the picture display will not be smooth and will be flickering. I also address this in my JavaScript code.

In fact, this is a part of my photo album web project. For the live demo of the slide show in my photo album, click here.

Using the code

To use the source, unzip the project files to a folder, load the Slideshow.sln in Visual Studio 2005, and run it.

Hope my post is useful to you. Enjoy!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Lang Deng
Web Developer
United States United States
No Biography provided

Comments and Discussions

QuestionThis is very good article. PinmemberJayesh Sorathia22-Feb-13 20:44 
QuestionMozilla Error PinmemberMember 792121723-Jul-12 2:45 
QuestionFinally got the concept PinmemberMember 466304315-Feb-12 21:06 
GeneralMy vote of 5 PinmemberMember 466304315-Feb-12 21:05 
GeneralMy vote of 4 Pinmemberveerendra.p22-Jun-11 21:37 
GeneralSlideshow does not ID Pinmember55kamelot554-Mar-11 9:26 
QuestionSlide show does not work PinmemberColeenh28-Sep-10 2:15 
GeneralMozilla FireFox Pinmembermohsen.karami2-Aug-10 8:55 
Generalslide show Pinmembernaveen.prasad15228-Jun-10 2:56 
GeneralMy vote of 1 Pinmemberravichaudhari14-Jun-10 23:55 
GeneralCode Not Compatable with Different Browsers. Pinmembernehathakurcodeproject3-Dec-09 20:45 
GeneralDemosite PinmemberMarkus Bertram26-Jul-09 21:03 
QuestionUrl Path PinmemberManoj Kiean24-Jun-09 21:22 
Generalcode for prev and next Pinmemberxccx9-Jun-09 11:28 
GeneralExcellent Code - Modified !!! PinmemberKeith Pitts20-Apr-09 10:32 
GeneralRe: Excellent Code - Modified !!! Pinmemberxccx9-Jun-09 11:23 
GeneralRe: Excellent Code - Modified !!! PinmemberMember 792121723-Jul-12 2:51 
Questionhow to make every image as a link in slide show PinmemberMember 36801427-Apr-09 21:14 
Questionhow to using silde show 3 time on one page!! Pinmemberkenuycyc17-Mar-09 9:17 
QuestionHow to limit transition effects? PinmemberPeter Afonin8-Feb-09 16:12 
GeneralThe Master Page PinmemberShakthivelpr4-Feb-09 23:36 
QuestionTransitions in IE AND in Firefox? PinmemberPCAssist_Northwest17-Jan-09 21:44 
GeneralDo you have the code...... Pinmembert-hawkbasketball4-Oct-08 14:59 
GeneralDeng It's Awesome!!! PinmemberM. Shakeel Anjum21-Jul-08 21:59 
GeneralRandom to Ordered Pinmemberasewefy19-Sep-07 23:17 
GeneralNo thumbnails PinmemberEdwardJr21-Aug-07 9:06 
GeneralRe: No thumbnails PinmemberLang Deng21-Aug-07 9:23 
GeneralRe: No thumbnails PinmemberEdwardJr21-Aug-07 10:03 
QuestionWeb Photo Album Pinmembersides_dale28-May-07 15:53 
AnswerRe: Web Photo Album PinmemberLang Deng29-May-07 13:39 
GeneralMaster Page Pinmemberalexaz17-May-07 9:18 
GeneralRe: Master Page PinmemberLang Deng7-May-07 14:56 
GeneralDoesn't work in Firefox Pinmembercykophysh3923-Feb-07 0:08 
QuestionDose not support mozilla browser Pinmembergurusewack12-Jan-07 21:13 
AnswerRe: Dose not support mozilla browser Pinmembercykophysh3923-Feb-07 15:07 
QuestionAjax slideshow Pinmemberwagstaff31-Dec-06 16:32 
AnswerRe: Ajax slideshow PinmemberLang Deng1-Jan-07 8:41 
QuestionBanding of image at bottom PinmemberYoojin8-Dec-06 8:52 
Generalusing slideshow 3 times on one page Pinmemberlennied5-Dec-06 23:50 
GeneralRe: using slideshow 3 times on one page PinmemberLang Deng6-Dec-06 21:31 
GeneralRe: using slideshow 3 times on one page Pinmemberlennied6-Dec-06 23:52 
Generalgetting an error when servers wants to upload next image [modified] Pinmemberlennied5-Dec-06 2:52 
QuestionRe: getting an error when servers wants to upload next image [modified] Pinmemberwagstaff1-Jan-07 13:33 
GeneralDoesn't work at all in Firefox Pinmembercbgthree26-Nov-06 11:11 
GeneralRe: Doesn't work at all in Firefox PinmemberLang Deng26-Nov-06 11:37 
AnswerRe: Doesn't work at all in Firefox Pinmemberwagstaff1-Jan-07 11:41 
GeneralRe: Doesn't work at all in Firefox Pinmemberyann_lh17-Jan-07 16:51 
GeneralRe: Doesn't work at all in Firefox Pinmemberalkl12023-Apr-07 3:00 
GeneralRe: Doesn't work at all in Firefox PinmemberAzul SkyKnight6-Jun-07 6:33 
GeneralRe: Doesn't work at all in Firefox PinmemberDoan Quynh13-Nov-07 5:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 30 Mar 2006
Article Copyright 2006 by Lang Deng
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid