Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design 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 November 11th, 2004, 06:13 AM
Authorized User
 
Join Date: Oct 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to setup bgColor?


I have this code:

<form method="post" runat="server">
'I dont want to do it here
<body bgColor="gray">
.
.
</body>
</form>


I want to setup bgColor in the Page_Load Sub
How to do it??

I tried Page.bgColore="gray" but it's not work.



 
Old November 11th, 2004, 09:45 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I believe you can make the body tag 'runat="server"', then you need an instance of HtmlGenericControl for the body tag. Then you can use the attributes collection to set the attribute. Some like this...

<body runat="server" id="tagBody">

Protected tagBody As System.Web.UI.HtmlControls.HtmlGenericControl

tagBody.Attributes.Item("bgColor") = "gray"





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax change textbox bgcolor after Criteria met mkthompson Ajax 1 July 28th, 2008 08:56 AM
change bgColor crmpicco Javascript 1 July 9th, 2005 07:29 PM
Linking body, bgcolor"<%%>" to database brettdalldorf General .NET 7 June 17th, 2005 07:55 AM
onClick change bgcolor of entire row Pallav Javascript How-To 2 October 21st, 2004 12:35 AM





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