Blog - Microsoft .NET, ASP.NET, AJAX and more

Theme Error when Themes are disabled?

by Damien White 9/12/2007 2:11:59 PM

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.

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:
Categories: ASP.NET | C#
Actions: E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading