Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Add Css File

0 views
Skip to first unread message

shapper

unread,
Apr 15, 2008, 8:51:30 PM4/15/08
to
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

nick chan

unread,
Apr 16, 2008, 1:15:28 AM4/16/08
to
Init, page load or page complete . ur choice

Cowboy (Gregory A. Beamer)

unread,
Apr 16, 2008, 12:56:35 PM4/16/08
to
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!
|
*************************************************
"shapper" <mdm...@gmail.com> wrote in message
news:f770d4a2-4f34-4d5e...@8g2000hse.googlegroups.com...

0 new messages