Theme Error when Themes are disabled?

September 12, 2007 • Damien White

I received an interesting error today when I tried to create a WebForm which didn’t have any content on it.

Using themed css files requires a header control on the page. (e.g. <head runat=”server” />).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Using themed css files requires a header control on the page. (e.g. <head runat=”server” />).

Fair enough, I do have a Theme set in my Web.Config, so on to disable themes for the page, a la:

<%@ Page Language=C#” EnableTheming=false  %>

Run the page again, same error. What gives? Then I ran across Rick Strahl’s WebLog (specifically this: http://www.west-wind.com/WebLog/posts/4662.aspx).

The fix I ended up using was:

<%@ Page Language=C#” EnableTheming=false Theme=""  %>

A bit strange the disabling theming doesn’t take care of this.

Posted in asp.net, c# and tagged with ASP.NET

Damien White

I am a software architect with over 16 years of experience. I simply love coding! I have a driving passion for computers and software development, and a thirst for knowledge that just cannot be quenched. I'm happy to share what I know in my quest to learn as much as possible. I focus most of my time on web development using Ruby on Rails, Ember.js, and ASP.NET MVC.

comments powered by Disqus