473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Using CSS Stylesheet in a user control

Is there a special way to reference a Stylesheet (.css) in a usercontrol?
I have a usercontrol in an aspx page.The aspx page itself has a Header Div,
within which I put my UserControl.ascx. In the UserControl I want to use
DIVS only, just to make work easier at a future point. So, I have an outer
Div called HeaderContainer, and then some contained divs.

If this were just an aspx page, then all the rendering is fine, but when I
try to do so in a usercontrol, I do not get the proper results. If I attach
the stylesheet to the Usercontrol I get the proper rendering on my Visual
Studio 2005 page, but when the user control I place it on a test aspx page,
it does not show up properly. If I also attach the css file to the aspx
file, it shows up in the aspx page, but not in the browser. How can I get
it to show up properly in the browser?

TIA,

Paul
Feb 28 '06 #1
1 8764
DWS
Paul,
Simple work around is a panel around your user control and set the panel CSS
attributes.

Good Luck
DWS

"Paul" wrote:
Is there a special way to reference a Stylesheet (.css) in a usercontrol?
I have a usercontrol in an aspx page.The aspx page itself has a Header Div,
within which I put my UserControl.ascx. In the UserControl I want to use
DIVS only, just to make work easier at a future point. So, I have an outer
Div called HeaderContainer, and then some contained divs.

If this were just an aspx page, then all the rendering is fine, but when I
try to do so in a usercontrol, I do not get the proper results. If I attach
the stylesheet to the Usercontrol I get the proper rendering on my Visual
Studio 2005 page, but when the user control I place it on a test aspx page,
it does not show up properly. If I also attach the css file to the aspx
file, it shows up in the aspx page, but not in the browser. How can I get
it to show up properly in the browser?

TIA,

Paul

Mar 1 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eric Anderson | last post by:
I am trying to use XSLT to extend XHTML so that I can have custom widgets. For example I have a calendar control. Whenever I put the following in the psudo-XHTML doc: <calendarbox name="mycal"/>...
1
by: Amir Eshterayeh | last post by:
Dear Friends I need to change the css file of my aspx files dynamically so users can choose their css file names and when page loads, it read css file name from database. I try to use...
2
by: Nathan Sokalski | last post by:
I have a user control that uses classes from a CSS Stylesheet. Because a User Control does not have a <head> section, I do not know where to put a link tag to link it to the stylesheet. If I...
7
by: Nathan Sokalski | last post by:
I have user controls that contain a link to a stylesheet. Several of my pages also have a link to this same stylesheet. Because of this, the resulting output contains multiple links to the same...
15
by: Scott W Gifford | last post by:
Hello, We've got a Web-based application written in Perl that is designed to integrate as a frame into many different Web sites. We currently have several stylesheets available to allow the...
1
by: mikeh3275 | last post by:
I have a header control that I include in my .aspx page. In this control, I'm trying to retrieve a cookie value and store it into a string, but I am receiving an "Object reference not set to an...
8
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then...
2
by: Andy B | last post by:
How do you use css in a user control? I need to put the css in a stylesheet outside of the control.
3
by: Dave Angel | last post by:
I have implemented the 'A list apart' styleswitcher which works great. I now have: - A permanent stylesheet - A normal contrast stylesheet - A high contrast stylesheet The switcher simply...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.