- ASP - Random Functions
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·What's New?
Mail List


Random Colors
Add a little bit of variety to the look of your website by randomly changing the colors of the page background, table cell backgrounds and/or hyperlinks. A random variable, a select case statement and response.write placed inside any color command enables you to show any range of colors you want.
View the Output
Text View
Print View
Mail this Link
Download the Code

<title> Colors)</title>
<body bgcolor="#FFFFFF">
dim g_random, color

' begin random function

' select a random number between one and five 

' Based on the randon number the following select case
' will assign a color to be displayed
select case g_random
case "1"
' blue
color ="#003366"
case "2"
' green
color ="#006633"
case "3"
' another green
color ="#999966"
case "4"
' another purple
color ="#663399"
case else
' red
color ="#660000"
end select

<table border="0" width="100%" align="center">
<td width="100%" bgcolor="<%= color %>" align="center">
<font color="#FFFFFF">The Current Color is <%= color %></font>
Click <a href="<%= request.servervariables("script_name") %>">
<font color="<%= color %>">here</font></a> to reload this page




ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement is hosted by
    Donate Food Online with a Mouse Click at
    Donate Land Online with a Mouse Click at
    © 1999 - 2018
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3