Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 15th, 2003, 05:05 PM
Authorized User
 
Join Date: Oct 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default change background

Hi

I was wondering how do you change a background color of html page,
from aspx page.
I know how to do it from a html page tried the same logic but didn't worh on my aspx page.

 
Old October 16th, 2003, 02:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It depends on your setup! However you can do it with style sheets like this...
Code:
<STYLE>
   BODY { background:#000000; }
</STYLE>
With the STYLE tags it has to be in the .aspx file, but you can put it in a seperate file aswell.

You say that you can't do it with the same logic as you used to. How is your setup? You have an aspx page, on which you have a BODY tag right!? Or?

Hope it helps

Jacob.


 
Old October 16th, 2003, 04:49 AM
Authorized User
 
Join Date: Oct 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I have evertthing in seperate files including my style sheets.
I tried for my aspx page document.body.style.bgcolor=variable
Get error it doesn't recognize Document

 
Old October 16th, 2003, 07:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you sure that the stuff declared in your style sheet is actually used? Does your inclusion of the external CSS file work!? If it does you should be able to include the following declaration in the style sheet file...
Code:
BODY { background:#000000; }
It works fine for me. Have you tried to view source after loading the page?

Hope it helps

Jacob.
 
Old October 16th, 2003, 08:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

If i were u I'll never try to do it in Server Side! do it by JavaScript on Client Side.

Always:),
Hovik Melkomian.
 
Old October 16th, 2003, 06:14 PM
Authorized User
 
Join Date: Oct 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My style sheet works fine, everything works. What i am asking is how to set the background color from aspx page, at run time.

Example The client is presented with a drop down box and he can select a color then press a submit button and change the background color.
I ve seen it down and not only that, the person calls a method from his style sheet which returns a string(Black) which is located in his aspx page.

Ex Body{
   background - color <% method name %>
}



I can di it from the client side using javascript was wondering how to do it from the server side.
Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
Change background color using CSS pigtail Javascript How-To 9 April 4th, 2010 11:13 AM
change color of background meena88 C# 2005 3 December 1st, 2009 04:48 AM
change background color of inputbox vickriz Javascript How-To 3 December 1st, 2009 02:22 AM
Change a Datagrid cell background hastikeyvan ASP.NET 2.0 Professional 2 October 7th, 2006 06:48 AM
Change a Datagrid cell background hastikeyvan ASP.NET 2.0 Basics 2 September 12th, 2006 11:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.