Re: Changing page bgcolor from code (repost)



Yes I REALLY want to set it at run time - please trust me on this. Not at
design time.

The reason why I don't simply set it in the body is because I want to set it
at run time.

your examples show it working but I can't see your code behind.

Maybe we are not communicating well. I want to find out how to set the
background color at run time from my code behind file.


--
Regards,
Gary Blakely
"Juan T. Llibre" <nomailreplies@xxxxxxxxxxx> wrote in message
news:OgkcqfVRGHA.1160@xxxxxxxxxxxxxxxxxxxxxxx
If that's all you want to do, why don't you simply do it,
by setting the <body background-color...> attribute ?

You aren't *really* attemptiong to change the background color
from code. You are just setting an arbitrary background color.

If that's all you want to do, why don't you just set it in the <body...>

Otherwise, use the code for the examples I posted.
Those samples allow users to select any background/foreground colors you
want to allow.



Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"GaryDean" <GaryDean@xxxxxxxxxxxxxxxxx> wrote in message
news:eXgJiXVRGHA.4792@xxxxxxxxxxxxxxxxxxxxxxx
In the original post I failed so indicate that I am using framework
1.1.......

I need to be able to change the background color of a page from code. I
found an answer to this question in another forum from Peter Huang that
said
that an id="bg" as follows...

<body MS_POSITIONING="GridLayout" runat="server" id="bg">

then we could do the following in our codebehind file....

Private Sub Page_Load(sender As Object, e As System.EventArgs)
bg.Attributes.Add("BgColor", "#ff9933")
End Sub

However, I get the errror that bg is Private.

Is there a solution to this issue where bgcolor, and other attributes of
the
document can be changed from codebehind code?


--
Regards,
Gary Blakely






.



Relevant Pages

  • Changing page bgcolor from code (repost)
    ... In the original post I failed so indicate that I am using framework ... I need to be able to change the background color of a page from code. ... Private Sub Page_Load ... document can be changed from codebehind code? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Change Cell Color dependent on Cell Contents
    ... Private Sub Worksheet_Change(ByVal Target As Range) ... > Private Sub Worksheet_Change ... > (remove nothere from the email address if mailing direct) ... I need to have the background color of the cells in Column ...
    (microsoft.public.excel.programming)
  • Re: Changing page bgcolor from code (repost)
    ... You aren't *really* attemptiong to change the background color ... You are just setting an arbitrary background color. ... Private Sub Page_Load ... document can be changed from codebehind code? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Automate Macro
    ... > Private Sub Worksheet_Change(ByVal Target As Range) ... >> would turn yellow. ... >> background color to blue that I can manually run it. ...
    (microsoft.public.excel.misc)
  • Re: Visual Basic .Net List Box
    ... > Private Sub Button1_Click(ByVal sender As System.Object, ... >>> added because the side scroll bar changes and I can scrolll throught ... >>> checked that the background color and the text color are different. ...
    (microsoft.public.dotnet.languages.vb)

Loading