Click here to Skip to main content
11,490,003 members (59,877 online)
Click here to Skip to main content

An ASP.NET Slide Show

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

Introduction

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!

License

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

Share

About the Author

Lang Deng
Web Developer
United States United States
No Biography provided

Comments and Discussions

 
QuestionThis is very good article. Pin
Jayesh Sorathia22-Feb-13 21:44
memberJayesh Sorathia22-Feb-13 21:44 
QuestionMozilla Error Pin
Member 792121723-Jul-12 3:45
memberMember 792121723-Jul-12 3:45 
QuestionFinally got the concept Pin
Member 466304315-Feb-12 22:06
memberMember 466304315-Feb-12 22:06 
GeneralMy vote of 5 Pin
Member 466304315-Feb-12 22:05
memberMember 466304315-Feb-12 22:05 
GeneralMy vote of 4 Pin
veerendra.p22-Jun-11 22:37
memberveerendra.p22-Jun-11 22:37 
GeneralSlideshow does not ID Pin
55kamelot554-Mar-11 10:26
member55kamelot554-Mar-11 10:26 
QuestionSlide show does not work Pin
Coleenh28-Sep-10 3:15
memberColeenh28-Sep-10 3:15 
GeneralMozilla FireFox Pin
mohsen.karami2-Aug-10 9:55
membermohsen.karami2-Aug-10 9:55 
Generalslide show Pin
naveen.prasad15228-Jun-10 3:56
membernaveen.prasad15228-Jun-10 3:56 
GeneralMy vote of 1 Pin
ravichaudhari15-Jun-10 0:55
memberravichaudhari15-Jun-10 0:55 
GeneralCode Not Compatable with Different Browsers. Pin
nehathakurcodeproject3-Dec-09 21:45
membernehathakurcodeproject3-Dec-09 21:45 
GeneralDemosite Pin
Markus Bertram26-Jul-09 22:03
memberMarkus Bertram26-Jul-09 22:03 
QuestionUrl Path Pin
Manoj Kiean24-Jun-09 22:22
memberManoj Kiean24-Jun-09 22:22 
Generalcode for prev and next Pin
xccx9-Jun-09 12:28
memberxccx9-Jun-09 12:28 
GeneralExcellent Code - Modified !!! Pin
Keith Pitts20-Apr-09 11:32
memberKeith Pitts20-Apr-09 11:32 
GeneralRe: Excellent Code - Modified !!! Pin
xccx9-Jun-09 12:23
memberxccx9-Jun-09 12:23 
GeneralRe: Excellent Code - Modified !!! Pin
Member 792121723-Jul-12 3:51
memberMember 792121723-Jul-12 3:51 
Questionhow to make every image as a link in slide show Pin
Member 36801427-Apr-09 22:14
memberMember 36801427-Apr-09 22:14 
Questionhow to using silde show 3 time on one page!! Pin
kenuycyc17-Mar-09 10:17
memberkenuycyc17-Mar-09 10:17 
QuestionHow to limit transition effects? Pin
Peter Afonin8-Feb-09 17:12
memberPeter Afonin8-Feb-09 17:12 
GeneralThe Master Page Pin
Shakthivelpr5-Feb-09 0:36
memberShakthivelpr5-Feb-09 0:36 
QuestionTransitions in IE AND in Firefox? Pin
PCAssist_Northwest17-Jan-09 22:44
memberPCAssist_Northwest17-Jan-09 22:44 
GeneralDo you have the code...... Pin
t-hawkbasketball4-Oct-08 15:59
membert-hawkbasketball4-Oct-08 15:59 
GeneralDeng It's Awesome!!! Pin
M. Shakeel Anjum21-Jul-08 22:59
memberM. Shakeel Anjum21-Jul-08 22:59 
GeneralRandom to Ordered Pin
asewefy20-Sep-07 0:17
memberasewefy20-Sep-07 0:17 
GeneralNo thumbnails Pin
EdwardJr21-Aug-07 10:06
memberEdwardJr21-Aug-07 10:06 
GeneralRe: No thumbnails Pin
Lang Deng21-Aug-07 10:23
memberLang Deng21-Aug-07 10:23 
GeneralRe: No thumbnails Pin
EdwardJr21-Aug-07 11:03
memberEdwardJr21-Aug-07 11:03 
QuestionWeb Photo Album Pin
sides_dale28-May-07 16:53
membersides_dale28-May-07 16:53 
AnswerRe: Web Photo Album Pin
Lang Deng29-May-07 14:39
memberLang Deng29-May-07 14:39 
GeneralMaster Page Pin
alexaz17-May-07 10:18
memberalexaz17-May-07 10:18 
GeneralRe: Master Page Pin
Lang Deng7-May-07 15:56
memberLang Deng7-May-07 15:56 
GeneralDoesn't work in Firefox Pin
cykophysh3923-Feb-07 1:08
membercykophysh3923-Feb-07 1:08 
QuestionDose not support mozilla browser Pin
gurusewack12-Jan-07 22:13
membergurusewack12-Jan-07 22:13 
AnswerRe: Dose not support mozilla browser Pin
cykophysh3923-Feb-07 16:07
membercykophysh3923-Feb-07 16:07 
QuestionAjax slideshow Pin
wagstaff31-Dec-06 17:32
memberwagstaff31-Dec-06 17:32 
AnswerRe: Ajax slideshow Pin
Lang Deng1-Jan-07 9:41
memberLang Deng1-Jan-07 9:41 
QuestionBanding of image at bottom Pin
Yoojin8-Dec-06 9:52
memberYoojin8-Dec-06 9:52 
Generalusing slideshow 3 times on one page Pin
lennied6-Dec-06 0:50
memberlennied6-Dec-06 0:50 
GeneralRe: using slideshow 3 times on one page Pin
Lang Deng6-Dec-06 22:31
memberLang Deng6-Dec-06 22:31 
GeneralRe: using slideshow 3 times on one page Pin
lennied7-Dec-06 0:52
memberlennied7-Dec-06 0:52 
Generalgetting an error when servers wants to upload next image [modified] Pin
lennied5-Dec-06 3:52
memberlennied5-Dec-06 3:52 
QuestionRe: getting an error when servers wants to upload next image [modified] Pin
wagstaff1-Jan-07 14:33
memberwagstaff1-Jan-07 14:33 
GeneralDoesn't work at all in Firefox Pin
cbgthree26-Nov-06 12:11
membercbgthree26-Nov-06 12:11 
GeneralRe: Doesn't work at all in Firefox Pin
Lang Deng26-Nov-06 12:37
memberLang Deng26-Nov-06 12:37 
AnswerRe: Doesn't work at all in Firefox Pin
wagstaff1-Jan-07 12:41
memberwagstaff1-Jan-07 12:41 
GeneralRe: Doesn't work at all in Firefox Pin
yann_lh17-Jan-07 17:51
memberyann_lh17-Jan-07 17:51 
GeneralRe: Doesn't work at all in Firefox Pin
alkl12023-Apr-07 4:00
memberalkl12023-Apr-07 4:00 
GeneralRe: Doesn't work at all in Firefox Pin
Azul SkyKnight6-Jun-07 7:33
memberAzul SkyKnight6-Jun-07 7:33 
GeneralRe: Doesn't work at all in Firefox Pin
Doan Quynh13-Nov-07 6:05
memberDoan Quynh13-Nov-07 6: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 | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 30 Mar 2006
Article Copyright 2006 by Lang Deng
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid