Click here to Skip to main content
Licence CPOL
First Posted 30 Mar 2006
Views 196,386
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
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  
GeneralNo thumbnails PinmemberEdwardJr9:06 21 Aug '07  
GeneralRe: No thumbnails PinmemberLang Deng9:23 21 Aug '07  
GeneralRe: No thumbnails PinmemberEdwardJr10:03 21 Aug '07  
QuestionWeb Photo Album Pinmembersides_dale15:53 28 May '07  
I liked the functions on your demo site. Is there anyway I can get a copy of the code you used there that allows you to click on the image and get more info.
AnswerRe: Web Photo Album PinmemberLang Deng13:39 29 May '07  
GeneralMaster Page Pinmemberalexaz19:18 7 May '07  
GeneralRe: Master Page PinmemberLang Deng14:56 7 May '07  
GeneralDoesn't work in Firefox Pinmembercykophysh390:08 23 Feb '07  
QuestionDose not support mozilla browser Pinmembergurusewack21:13 12 Jan '07  
AnswerRe: Dose not support mozilla browser Pinmembercykophysh3915:07 23 Feb '07  
QuestionAjax slideshow Pinmemberwagstaff16:32 31 Dec '06  
AnswerRe: Ajax slideshow PinmemberLang Deng8:41 1 Jan '07  
QuestionBanding of image at bottom PinmemberYoojin8:52 8 Dec '06  
Generalusing slideshow 3 times on one page Pinmemberlennied23:50 5 Dec '06  
GeneralRe: using slideshow 3 times on one page PinmemberLang Deng21:31 6 Dec '06  
GeneralRe: using slideshow 3 times on one page Pinmemberlennied23:52 6 Dec '06  
Generalgetting an error when servers wants to upload next image [modified] Pinmemberlennied2:52 5 Dec '06  
QuestionRe: getting an error when servers wants to upload next image [modified] Pinmemberwagstaff13:33 1 Jan '07  
GeneralDoesn't work at all in Firefox Pinmembercbgthree11:11 26 Nov '06  
GeneralRe: Doesn't work at all in Firefox PinmemberLang Deng11:37 26 Nov '06  
AnswerRe: Doesn't work at all in Firefox Pinmemberwagstaff11:41 1 Jan '07  
GeneralRe: Doesn't work at all in Firefox Pinmemberyann_lh16:51 17 Jan '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
Web01 | 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