469,593 Members | 1,970 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,593 developers. It's quick & easy.

Disable Asp.Net 2.0 Theme at page level

I've created a theme Css for my Asp.net 2.0 web application. The web.config
Pages Theme key is set to the theme name. Everything seams to work fine
except for any page that I want to disable the master theme and apply another
stylesheet.css.

According to the documentation I've read. I should be able to disable the
theme by setting the "enabletheming" attribute on the aspx Page to false.
This doesn't seam to work. When I look at the source of the generated page I
can see the link to the new stylesheet that I want but just prior to the body
tag I also see a reference to asp.net theme stylesheet that I'm tring to
disable.

Is this a bug? I've tried everything I know of to disable the theme at the
page level.
Apr 13 '06 #1
3 2684
Hi,

I agree that EnableTheming="false" doesn't seem to work. Weird.
Try this instead:

protected void Page_PreInit(object sender, EventArgs e)
{
Page.Theme = "";
}

HTH,

Chris

Apr 13 '06 #2
Hi,

I have the same problem, so far I've tried the following with no luck:
-Added EnableTheming="false" to Page directive
-Added Theme="" to Page directive
-Added Page.Theme="" to Page_PreInit event

just to give you a little bit more context: I'm setting theming in
web.config using:
<pages styleSheetTheme="White"/>
is this a bug in the framework? is there a workaround this?

Thanks,
PJ
"Chris Fulstow" wrote:
Hi,

I agree that EnableTheming="false" doesn't seem to work. Weird.
Try this instead:

protected void Page_PreInit(object sender, EventArgs e)
{
Page.Theme = "";
}

HTH,

Chris

May 27 '06 #3
Thanks Chris
Sorry for the delay but I got involved with some other issues!

Your work-around solved my problem. I had not thought about just setting
the page.Theme propery to an empty string.

I normally do not have to use Page_PreInt but for those pages I want to
override the application Theme I just use your work-around.

Its to bad the EnableTheming="false" page directive does not work as the
documentation states.

Thanks again

"Chris Fulstow" wrote:
Hi,

I agree that EnableTheming="false" doesn't seem to work. Weird.
Try this instead:

protected void Page_PreInit(object sender, EventArgs e)
{
Page.Theme = "";
}

HTH,

Chris

May 27 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Miguel Dias Moura | last post: by
reply views Thread by damiensawyer | last post: by
4 posts views Thread by Ben | last post: by
reply views Thread by Larry Bud | last post: by
4 posts views Thread by =?Utf-8?B?TUNN?= | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.