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.

Shout it kick it on DotNetKicks.com Bookmark and Share
Tags:
Categories: ASP.NET | C#
Actions: E-mail | Permalink | Comments (3) | Comment RSSRSS comment feed

Comments

3/11/2008 1:11:10 PM #

Justin S

Thanks for this post!  I was having the same problem with a non-site themed page where all its contents were added at runtime.  When I saw your post it was like a smack to the side of my head to wake me up.

Justin S

1/19/2009 4:27:10 AM #

inventory management software

thanks for the info...
it solve my problem...

inventory management software United Kingdom

2/19/2009 1:56:40 AM #

Web Hosting Reviews

you're a legend!

Web Hosting Reviews Australia

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading