Add Css File

  • Thread starter Thread starter shapper
  • Start date Start date
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
 
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.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
 
Back
Top