首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >使用主题化的css文件需要页面上的header控件。(例如<head runat="server“/>)

使用主题化的css文件需要页面上的header控件。(例如<head runat="server“/>)
EN

Stack Overflow用户
提问于 2010-05-07 02:41:19
回答 5查看 22K关注 0票数 19

我正在做asp.net web项目。当我运行这个项目时,它工作正常。但在服务器中,我得到了以下错误。如何解决这个问题?

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. How to solve this problem?

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

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[InvalidOperationException: Using themed css files requires a header control on the page. (e.g. <head runat="server" />).]
   System.Web.UI.PageTheme.SetStyleSheet() +2458406
   System.Web.UI.Page.OnInit(EventArgs e) +8699420
   System.Web.UI.Control.InitRecursive(Control namingContainer) +333
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,  Boolean includeStagesAfterAsyncPoint) +378
EN

回答 5

Stack Overflow用户

发布于 2010-05-07 02:43:17

您需要在页面(或母版页)中使用带有服务器“runat=”的head标记,如下所示

<head runat="server">
    <title></title>
</head>
票数 12
EN

Stack Overflow用户

发布于 2012-11-24 03:52:49

确保bin文件夹中只包含您需要的文件。如果你有其他的dll(实际dll的旧版本只是根据它们的名字变化),奇怪的事情可能会发生。

票数 1
EN

Stack Overflow用户

发布于 2012-02-15 20:14:55

我得到这个错误是因为Visual Studio2008中非常糟糕的复制和粘贴错误。我用一些原本打算通过电子邮件发送给朋友的代码碎片替换了这个页面。

尽管杀死了aspx页面的所有内容,但它没有抛出其他错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2783545

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档