Adding CssClass on .ascx page

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
 
G

Guest

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")
 
H

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,294
Latest member
LandonPigo

Latest Threads

Top