Newbie question - change page background colour

J

JezB

Can you change the page background colour in the code-behind module ? or is
it HTML encoded and therefore only programmable via javascript ?
 
C

Curt_C [MVP]

give the <body> tag a runat server then call it's Attributes[] tag to set
the background color
 
J

JezB

Sorry for being dense - a Page object does not have an Attributes property,
I dont know how to get a Body object from the code-behind module.

Curt_C said:
give the <body> tag a runat server then call it's Attributes[] tag to set
the background color

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


JezB said:
What object do I refer to?
The Page object does not have a BackColor property.

or
is
 
K

kdub

In the code behind:

Public strBodyColor as String

Then set the string in the Page Load event


In the ASPX file:

<body color='<%strBodyColor%>'>

This will write the value of the string from the code behind onto the ASPX
page.

Kevin
 
C

Curt_C [MVP]

I NEVER SAID PAGE....
I SAID <BODY>

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


JezB said:
Sorry for being dense - a Page object does not have an Attributes property,
I dont know how to get a Body object from the code-behind module.

Curt_C said:
give the <body> tag a runat server then call it's Attributes[] tag to set
the background color

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


JezB said:
What object do I refer to?
The Page object does not have a BackColor property.

Can you change the page background colour in the code-behind module
?
 
J

JezB

Are you keeping it a secret how to get a Body object from within the
code-behind module ?

Curt_C said:
I NEVER SAID PAGE....
I SAID <BODY>

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


JezB said:
Sorry for being dense - a Page object does not have an Attributes property,
I dont know how to get a Body object from the code-behind module.

Curt_C said:
give the <body> tag a runat server then call it's Attributes[] tag to set
the background color

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


What object do I refer to?
The Page object does not have a BackColor property.

Can you change the page background colour in the code-behind
module
 
K

kdub

In the code behind, add:

Public strBodyColor as String

Then set the string in the Page Load event or whereever else you like.


In the ASPX file, edit your body tag:

<body color='<%=strBodyColor%>'>

This will write the value of the string from the code behind onto the ASPX
page.

Kevin


JezB said:
Can you change the page background colour in the code-behind module ? or is
it HTML encoded and therefore only programmable via javascript ?




JezB said:
Are you keeping it a secret how to get a Body object from within the
code-behind module ?

Curt_C said:
I NEVER SAID PAGE....
I SAID <BODY>

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


JezB said:
Sorry for being dense - a Page object does not have an Attributes property,
I dont know how to get a Body object from the code-behind module.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
give the <body> tag a runat server then call it's Attributes[] tag
to
set
the background color

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


What object do I refer to?
The Page object does not have a BackColor property.

Can you change the page background colour in the code-behind
module
?
or
is
it HTML encoded and therefore only programmable via javascript ?
 
C

Curt_C [MVP]

once again...
Add a "runat=server" to the <BODY> tag.
In the codebehind make the declaration as a generic html contol.
call it.

Also, did you try to look it up at all? in < 30 seconds of searching I found
dozens of references to it.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


JezB said:
Are you keeping it a secret how to get a Body object from within the
code-behind module ?

Curt_C said:
I NEVER SAID PAGE....
I SAID <BODY>

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


JezB said:
Sorry for being dense - a Page object does not have an Attributes property,
I dont know how to get a Body object from the code-behind module.

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
give the <body> tag a runat server then call it's Attributes[] tag
to
set
the background color

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com


What object do I refer to?
The Page object does not have a BackColor property.

Can you change the page background colour in the code-behind
module
?
or
is
it HTML encoded and therefore only programmable via javascript ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top