我正在做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
发布于 2010-05-07 02:43:17
您需要在页面(或母版页)中使用带有服务器“runat=”的head标记,如下所示
<head runat="server">
<title></title>
</head>
发布于 2012-11-24 03:52:49
确保bin文件夹中只包含您需要的文件。如果你有其他的dll(实际dll的旧版本只是根据它们的名字变化),奇怪的事情可能会发生。
发布于 2012-02-15 20:14:55
我得到这个错误是因为Visual Studio2008中非常糟糕的复制和粘贴错误。我用一些原本打算通过电子邮件发送给朋友的代码碎片替换了这个页面。
尽管杀死了aspx页面的所有内容,但它没有抛出其他错误。
https://stackoverflow.com/questions/2783545
复制相似问题