Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 June 19th, 2004, 04:31 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 245
Thanks: 0
Thanked 0 Times in 0 Posts
Default Setting BgColor in UserControl (.ascx)

Hello
I am trying to set a background color in User Control (.ascx).
But when I click on properties of .ascx bgcolor is not listed.

Do I do this in html?

Thanks.

 
Old June 19th, 2004, 04:51 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, you can do that.

Since a UC is not a complete page, you cannot set the bgcolor attribute of the <body> tag (which isn't a good idea anyway).
To change the color of your UC, wrap the entire contents in a <div> like this:

<div style="background-color:#fff;color:#000;">
Your UC contents here
</div>

Alternatively, you could give your <div> an ID and then control its experience in an external style sheet.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Inertia Creeps by Massive Attack (Track 4 from the album: Mezzanine) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with Matrix - BGcolor & hide column roy_mm Reporting Services 1 October 30th, 2006 10:12 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
How to setup bgColor? liorlankri ASP.NET 1.x and 2.0 Application Design 1 November 11th, 2004 09:45 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.