Home All Groups Group Topic Archive Search About

Adding CssClass on .ascx page

Author
24 Nov 2005 10:02 AM
Niclas Lindblom
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 ***

Author
24 Nov 2005 11:00 AM
Santhi Maadhaven
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")

Show quoteHide quote
"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 ***
>
Are all your drivers up to date? click for free checkup

Author
24 Nov 2005 11:10 AM
Hans Kesting
> 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

Bookmark and Share