Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > change background color

Reply
Thread Tools

change background color

 
 
=?Utf-8?B?cm9kY2hhcg==?=
Guest
Posts: n/a
 
      03-02-2007
hey all,
is there an easy way to change the background color of the page in the
code-behind?

thanks,
rodchar
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
Guest
Posts: n/a
 
      03-02-2007
Hi there,

-- aspx code --

<body runat="server" id="myBody">
html content
</body>

-- c# code behind --

myBody.Attributes["bgcolor"] = "red";
//or
myBody.Style.Add(HtmlTextWriterStyle.BackgroundCol or, "red");
// or
myBody.Style.Add("background-color", "red");

hope it helps
--
--
Milosz


"rodchar" wrote:

> hey all,
> is there an easy way to change the background color of the page in the
> code-behind?
>
> thanks,
> rodchar

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing font color from current font color to black color Kamaljeet Saini Ruby 0 02-13-2009 04:58 PM
rounded corners in which my border color is different than the background color laredotornado@zipmail.com Javascript 1 02-14-2007 07:37 AM
not able to click on background tab and backgrounds in properties to change the background. rex Computer Support 2 12-06-2006 02:26 AM
Problem with setting background color alternating item in datalist to a certain color fig000 ASP .Net Web Controls 0 09-06-2004 06:51 PM
How do i change background color to transparent Ather Ali Shaikh ASP .Net 1 12-04-2003 07:00 PM



Advertisments