Search - Articles - Dev Forums - Favorites - Member Login
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009


Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Build the right apps the right way with powerful development tools.
Visual Studio 2010. Learn more...
Change Your Background Color of Web Page Using JavaScript

Author: DevASP
Download Source Code : 533_BgcolorChanger.zip

This article is about how you can change the background color of your web page randomly, and how you can give the option to your user that he can change the background color of your web page according

Steps you will do.

Start visual studio and create a new web application.

Open the HTML design of your web page and change that code with the following code .This will design the layout of your web page and make the links on page to change the colors. When you move the mouse over any of that color the background color of the page will be changed.

 

<html>

 <head>

 <title>color changer</title>

<meta name="generator" content="microsoft visual studio .net 7.1">

<meta name="code_language" content="visual basic .net 7.1">

<meta name="vs_defaultclientscript" content="javascript">

<meta name="vs_targetschema" content="http://schemas.microsoft.com/intellisense/ie5">

 

</head>

 

<body>

 

<center>

 

[<a href="/" onmouseover="document.bgcolor='green'">green</a>] [<a href="/" onmouseover="document.bgcolor='greem'">bright

green</a>] [<a href="/" onmouseover="document.bgcolor='seagreen'">sea green</a>]

 

[<a href="/" onmouseover="document.bgcolor='red'">red</a>]<br>

 

[<a href="/" onmouseover="document.bgcolor='magenta'">magenta</a>] [<a href="/" onmouseover="document.bgcolor='fusia'">fusia</a>]

 

[<a href="/" onmouseover="document.bgcolor='pink'">pink</a>] [<a href="/" onmouseover="document.bgcolor='purple'">purple</a>]<br>

 

[<a href="/" onmouseover="document.bgcolor='navy'">navy</a>] [<a href="/" onmouseover="document.bgcolor='blue'">blue</a>]

[<a href="/" onmouseover="document.bgcolor='royalblue'">royal blue</a>] [<a href="/" onmouseover="document.bgcolor='skyblue'">sky blue</a>]<br>

 

[<a href="/" onmouseover="document.bgcolor='yellow'">yellow</a>] [<a href="/" onmouseover="document.bgcolor='brown'">brown</a>]

 

[<a href="/" onmouseover="document.bgcolor='almond'">almond</a>] [<a href="/" onmouseover="document.bgcolor='white'">white</a>]<br>

 

[<a href="/" onmouseover="document.bgcolor='black'">black</a>] [<a href="/" onmouseover="document.bgcolor='coral'">coral</a>]

 

[<a href="/" onmouseover="document.bgcolor='olivedrab'">olive drab</a>] [<a href="/" onmouseover="document.bgcolor='orange'">orange</a>]

 

<br>

<br>

<h4>dont forget to visit www.devasp.com</h4>

<a href="http://www.devasp.com">devasp team</a>

 

</center>

</body>

</html>

 

 

Run your application and move the cursor to any of the given colors. NOTE that you can also give more color option by editing in the HTML and adding more HTML tags.

Article Comments
i am sorry to say sir,this artical is not working and giving me the error as
Error Type:
Active Server Pages, ASP 0134 (0x80004005)
The object has an invalid ProgID of 'MSWC.MyInfo'.
//global.asa, line 1

Posted on 5/14/2007 7:52:52 AM by swetha

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Age finder Application Using ASP.NET and JavaScript

Disclaimer - Privacy
© 2002-2010 DevASP.net