Click here to Skip to main content
Licence CPOL
First Posted 30 Mar 2006
Views 196,408
Bookmarked 75 times

An ASP.NET Slide Show

By | 30 Mar 2006 | Article
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)

About the Author

Lang Deng

Web Developer

United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionFinally got the concept PinmemberMember 466304321:06 15 Feb '12  
GeneralMy vote of 5 PinmemberMember 466304321:05 15 Feb '12  
GeneralMy vote of 4 Pinmemberveerendra.p21:37 22 Jun '11  
GeneralSlideshow does not ID Pinmember55kamelot559:26 4 Mar '11  
QuestionSlide show does not work PinmemberColeenh2:15 28 Sep '10  
GeneralMozilla FireFox Pinmembermohsen.karami8:55 2 Aug '10  
Generalslide show Pinmembernaveen.prasad1522:56 28 Jun '10  
GeneralMy vote of 1 Pinmemberravichaudhari23:55 14 Jun '10  
GeneralCode Not Compatable with Different Browsers. Pinmembernehathakurcodeproject20:45 3 Dec '09  
GeneralDemosite PinmemberMarkus Bertram21:03 26 Jul '09  
QuestionUrl Path PinmemberManoj Kiean21:22 24 Jun '09  
Generalcode for prev and next Pinmemberxccx11:28 9 Jun '09  
GeneralExcellent Code - Modified !!! PinmemberKeith Pitts10:32 20 Apr '09  
GeneralRe: Excellent Code - Modified !!! Pinmemberxccx11:23 9 Jun '09  
Questionhow to make every image as a link in slide show PinmemberMember 368014221:14 7 Apr '09  
Questionhow to using silde show 3 time on one page!! Pinmemberkenuycyc9:17 17 Mar '09  
QuestionHow to limit transition effects? PinmemberPeter Afonin16:12 8 Feb '09  
GeneralThe Master Page PinmemberShakthivelpr23:36 4 Feb '09  
QuestionTransitions in IE AND in Firefox? PinmemberPCAssist_Northwest21:44 17 Jan '09  
GeneralDo you have the code...... Pinmembert-hawkbasketball14:59 4 Oct '08  
GeneralDeng It's Awesome!!! PinmemberM. Shakeel Anjum21:59 21 Jul '08  
GeneralRandom to Ordered Pinmemberasewefy23:17 19 Sep '07  
Thanks a lot for this article, but what if i need to make the slide show advance in order not randomly,
Thanks so much for your help.
GeneralNo thumbnails PinmemberEdwardJr9:06 21 Aug '07  
GeneralRe: No thumbnails PinmemberLang Deng9:23 21 Aug '07  
GeneralRe: No thumbnails PinmemberEdwardJr10:03 21 Aug '07  

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.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120529.1 | Last Updated 30 Mar 2006
Article Copyright 2006 by Lang Deng
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid