473,396 Members | 1,767 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,396 software developers and data experts.

Adding CssClass on .ascx page

Hi,

I would like to use a separate stylesheet for a .ascx module without
changning the stylesheet that is referenced in the .aspx page <HEAD>
section

Is it possible to reference another stylesheet from a .ascx page and
possibly load it from code ?

Niclas

*** Sent via Developersdex http://www.developersdex.com ***
Nov 24 '05 #1
2 6308
You cant add specific stylesheet as reference in your .ascx control.But u can
do programmatically for each control included in ur .ascx file using

Controlname.Style.Add("color",'red')
or
Controlname.Attributes.Add("style","color:red")

"Niclas Lindblom" wrote:
Hi,

I would like to use a separate stylesheet for a .ascx module without
changning the stylesheet that is referenced in the .aspx page <HEAD>
section

Is it possible to reference another stylesheet from a .ascx page and
possibly load it from code ?

Niclas

*** Sent via Developersdex http://www.developersdex.com ***

Nov 24 '05 #2
> Hi,

I would like to use a separate stylesheet for a .ascx module without
changning the stylesheet that is referenced in the .aspx page <HEAD>
section

Is it possible to reference another stylesheet from a .ascx page and
possibly load it from code ?

Niclas


I don't think it is possible, as the ascx doesn't exist as a separate
entity when the page output has arrived at the browser. The output of
all your ascx'es (and the aspx) is combined into a single html file.
You can't specify a css to apply to just a *part* of your html file.

Hans Kesting
Nov 24 '05 #3

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

Similar topics

5
by: Jeremy Ames | last post by:
I have run into a major road block with my page development projects. I am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because...
1
by: C Downey | last post by:
I have a registration form that should load different web user controls based on the selection of a dropdown list. Basically, the user follows the following steps: 1. user comes to very basic...
1
by: Guest | last post by:
i want to insert a swf file in a .net page ,but it doesn't load in run mode this is the code: <td width="100%" colspan="2" height="3"> <object width="90%" height="50"> <param name="movie"...
2
by: krallabandi | last post by:
I have a hidden control <input id="FieldSortOrder" type="hidden" name="FieldSortOrder" runat="server"> in a ascx page. I want to store some value in this control in the code behind page. ...
2
by: asgars | last post by:
hi friends, i am having an aspx page. i want to clear its viewstate on a particular condition. Is that possible? If yes, how can i do so? Plz help me.
5
by: strikefiend | last post by:
Ok, I'm somewhat new to .NET C# language and am having a bit of trouble. I'm trying to run the javascript confirm() method from my ascx page but I'm currently using C# as the main language of the...
1
by: aekta | last post by:
Hello , I am dynamically loading an usercontrol using LoadControl() in my one of .aspx page . My user control consists of a dropdown list . There is a subroutine named "dropch" in my...
3
by: Montu76 | last post by:
Hi All, I want to pass values from .apsx page(textbox value) to .ascx page. Any sort of help will be appreciated. Regards
34
by: ismailc | last post by:
Good day, not sure what to do. I have an ascx page with the code displaying the user logged in, i created an iframe src displaying a report but i want to add the logged in id as parameter but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.