Click here to Skip to main content
15,867,686 members
Articles / Web Development / ASP.NET
Article

Slide Show - New, Improved

Rate me:
Please Sign up or sign in to vote.
2.50/5 (6 votes)
21 Mar 20032 min read 115.6K   1.6K   42   8
Mimics PowerPoint functionality & can be used for short text messages

Sample Image - newss.jpg

Introduction

Nothing beats Powerpoint when it comes to presentations, right? The new Slide Show utility (check the older Slide Show[^]) attempts to mimic the same functionality for short text messages, minus all the fireworks, using JavaScript.

So what's new?

In the earlier version, I had used Frames ( now Div tag is used ) and you had to click on the buttons to move back and forth. Now the slides can be made to run automatically. The Show restarts once we come to the end of the Slide list. Moreover you can choose from a dynamic list of external JavaScript files, each of which may contain content on different topics.

Source code

The zipped source code file consists of -

  1. settings.aspx
  2. show.aspx
  3. sample .js files

How it works

You will need the .NET Framework to run the app.

The Setting.aspx dynamically picks up all the JS files in a specified folder and populates them into the listBox. On choosing a particular option from the listbox, i.e. the name of a JS file, that JS file is loaded on the fly, into the Show.aspx page and the first slide which is derived from a string array in the JS file shows up.

Here is the code to hookup the external JS file from Settings.aspx to Show.aspx

JavaScript
<script> 
var quip = new Array();
document.write('<script LANGUAGE="JavaScript" 
SRC="js/<%=Request.Params("extfile")%>"><\/SCRIPT>');
</script>

In the Show.aspx page , the messages can be scrolled both forward and backward using the buttons or it could be set to self-run mode.

The text for each slide can be a small message and this will be stored into each element of the string array of each JS file. The array size can be of variable length and additional messages can be added anytime to the external JavaScript file.

All the JS files have the same array called quip defined and the index of the array is a global variable which is controlled by the functions in Show.aspx.

You can change the time interval between 2 slides by setting the value in window.setTimeOut. In the example, it has been set to 1 sec.

JavaScript
myTimer=window.setTimeout("automato()",1000)

Even image tags can be inserted into the array in place of a string and an image slide show can also be performed.

This code can be modifed to make it run in Classic ASP too. BTW, isn't Classic ASP an oxymoron?

References

Links

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect
India India
'Anil' Radhakrishna is a seasoned architect who enjoys working with Microsoft tools & technologies. He blogs quite regularly about his little discoveries and technical experiments on his blog called Tech Tips, Tricks & Trivia. He loves building mash-ups using public Web APIs.

Comments and Discussions

 
GeneralMy vote of 1 Pin
satyam_dreams13-May-10 21:14
satyam_dreams13-May-10 21:14 
Generalcategorywise slideshow of images Pin
vijeet dhupia16-Aug-07 1:29
vijeet dhupia16-Aug-07 1:29 
GeneralNice Idea - doesn't implement in ASP.NET 2.0 & VS Pin
Cody_2111-Apr-07 6:27
Cody_2111-Apr-07 6:27 
GeneralRe: Nice Idea - doesn't implement in ASP.NET 2.0 & VS Pin
'Anil' Radhakrishna11-Apr-07 20:01
'Anil' Radhakrishna11-Apr-07 20:01 
GeneralPhoto Slide Show in ASP.NET Pin
DHARMA.R6-Jun-04 19:19
DHARMA.R6-Jun-04 19:19 
GeneralRe: Photo Slide Show in ASP.NET Pin
'Anil' Radhakrishna8-Jun-04 1:00
'Anil' Radhakrishna8-Jun-04 1:00 
GeneralRe: Photo Slide Show in ASP.NET Pin
DHARMA.R8-Jun-04 3:07
DHARMA.R8-Jun-04 3:07 
Generalaccessing a function from an external .js file Pin
gin_blossoms18-Jan-04 7:25
gin_blossoms18-Jan-04 7:25 

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

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