Adding CssClass on .ascx page

  • Thread starter Thread starter Niclas Lindblom
  • Start date Start date
N

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
 
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")
 
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
 
Back
Top