CodeAve.com CodeAve.com - ASP - Random Functions
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


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

<html>
<title>CodeAve.com(Random Colors)</title>
<body bgcolor="#FFFFFF">
<%
dim g_random, color

' begin random function
randomize

' select a random number between one and five 
g_random=int(rnd*5)+1

' 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">
<tr>
<td width="100%" bgcolor="<%= color %>" align="center">
<font color="#FFFFFF">The Current Color is <%= color %></font>
</td>
</tr>
</table>
<br>
<center>
Click <a href="<%= request.servervariables("script_name") %>">
<font color="<%= color %>">here</font></a> to reload this page
</center>
</body>
</html>

 

 

 



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

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

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