Add Css File

S

shapper

Hello,

I am adding, in a page, a reference to a CSS file at runtime as
follows:

Dim base As HtmlGenericControl = New HtmlGenericControl("style")
With base
.Attributes.Add("type", "text/css")
.Attributes.Add("media", "Screen")
.InnerText = "@import url(App_Assets/PT/Styles/Base.css);"
End With
Page.Header.Controls.Add(base)

In which Page Event should I do this?

Thanks,

Miguel
 
C

Cowboy \(Gregory A. Beamer\)

This one is pretty wide open, as far as events, but why do this at all.

A better option, in many cases, is to set up themes. You can then use your
base class (from another thread) and set the theme there. Then you do not
end up creating dynamic links to CSS pages, which are harder to control.
 

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,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top