How to: Disable ASP.NET Themes
You can configure a page or control to ignore themes. Themes override local settings for page and control appearance by default. Disabling this behavior is useful when a control or page already has a predefined look that you do not want the theme to override.
Note |
|---|
You can give precedence to control settings on the current page by applying a theme as a style sheet theme. In that case, the theme is used to set properties that have no local settings, but explicit local settings take precedence. For details, see How to: Apply ASP.NET Themes. |
To disable themes for a page
Set the EnableTheming attribute of the @ Page directive to false, as in this example:
<%@ Page EnableTheming="false" %>
To disable themes for a control
Set the EnableTheming property of the control to false, as in this example:
<asp:Calendar id="Calendar1" runat="server" EnableTheming="false" />
Daft
None of these solutions work. I think it's absurd that the web.config setting overrides the page setting. Surely logic would dictate that the page setting would override the global setting to allow greater granularity of control over themes?? I can only imagine this was an oversight by MS. I now have no way of preventing an InvalidOperationException being thrown other than not calling the base method in my OnInit or being forced to include a runat="server" tag.
- 11/23/2011
- Garry-Passarella
Setting the EnableTheming attribute of the @ Page directive to false doesn't seam to work!
<%@ Page EnableTheming="false" %> doesn't seam to work! I think it is a bug. <%@ Page Theme="" %> helps.
- 5/2/2010
- Roman L. Pelepei
- 5/2/2010
- Roman L. Pelepei
Note