You have been redirected to CoverYourASP.com - find out why and how!
 
ASP/.NET Web Hosting
* 3 Months FREE *
CLICK HERE!
 CoverYourASP --> Rotate banners

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
117 active users
4093 visitors today
4337 pages today
(only part of today)
ASP.NET Showcase
ASP.NET Graph and Chart Component with FREE developer version

ASP.NET Shopping Cart and E-commerce Control with FREE trial download

ASP.NET Web Hosting with free month and setup

$15 Domain Name Registration from .DNR.
As seen on these sites
Special thanks go to the sites that support me by publishing my articles.
See more

CoverYourASP
Copyright © 1999-2008 James Shaw.
All rights reserved.

ASP.NET Blog
ASPRSS
ShawThing

Now open source with SourceForge!

See that extra content on the right of this page? Refresh the page and you'll see that different items are displayed in a different order each time. (Actually, the one or two top items may not change - they are reserved for advertisers)

This shows a good use (maybe the only one) of JavaScript's Math.random() function. Using this and a couple of arrays it's a snap to provide functionality like this.

Just as on most of my pages I don't have enough space to show all my links, so I can pass into the ShowBanners function the number to display.

(If you do want to see all the links on a page reserved for just for them, go here).

The banners are stored in my database (in the MyBanners table), and the contents copied into Application variables at the start of each day.

This method is perfect for banners - they change rarely, but are displayed often (on virtually every page), so the speed and scalability of Application variables has a huge effect. Read more about this process in this article.

Featured sponsor
My favorite resources

Selling products online - read how James does it now



I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...


Qualify for Free Trade Magazines

Free subscriptions to industry leading publications for those who qualify!