I Can't Make Heads of Tails of This Bug

Discussion in 'ASP.NET 2.0' started by ScottSolomo, May 24, 2005.

  1. can be viewed by going to: http://beta-153014.server1.dotnetsandbox.net/


    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    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' />).

    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() +1929526
    System.Web.UI.Page.OnInit(EventArgs e) +1988674
    System.Web.UI.Control.InitRecursive(Control namingContainer) +316
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +694
     
  2. Bruce

    Bruce DiscountASP.NET Staff

  3. Yes, the code ' <head runat='server' /> ' is on the Default_Master page, which provides the global style, I guess CSS, for all the site pages. The code ' <head runat='server' /> ' is not on any of the other pages. When I put that code on another page, such as the Default (home) page, several errors result. I put that code at the top of the page, and all of a sudden, a lot of the HTML becomes underlined indicating errors. The error says, 'per the active schema, 'head' cannot be nested within 'form'.'

    Should I place the line: <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'> before <head runat='server' /> in the other pages? Or should I place <head runat='server' /> somewhere before or within:

    <%@ Page Language='VB' MasterPageFile='~/Default.master' Title='Scott Solomon | Home'
    CodeFile='Default.aspx.vb' Inherits='Default_aspx' %>

    <asp:content id='Content1' contentplaceholderid='Main' runat='server'>

    the error was appearing when I placed the <head runat='server' /> code right after the code above.
     
  4. The problem may stem from this line of my web.config file:

    <customErrors mode='RemoteOnly' defaultRedirect='mydocument.htm'/>

    where there i have not created a mydocument.htm.
     
  5. Nope, now customerrors is set to 'Off' and I get that.
     
  6. I am getting this also...noticed something interesting though:


    If I just type in the name of the site (not specifying the default page) then I get the error. If I actually type in the name of the default page (/Default.aspx) on the end of the website name then it loads fine.


    I have a <Head runat="server"> on my master page also.


    Any ideas?





    David
     
  7. I tried to use a DataList with an XMLDataSource, but when i run the site I get this error message:

    Server Error in '/Personal Site Number 2' Application.
    --------------------------------------------------------------------------------

    Only <siteMapNode> elements are allowed at this location.
    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.Configuration.ConfigurationErrorsException: Only <siteMapNode> elements are allowed at this location.

    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:


    [ConfigurationErrorsException: Only <siteMapNode> elements are allowed at this location.]
    System.Web.XmlSiteMapProvider.ConvertFromXmlNode(Queue queue) +264
    System.Web.XmlSiteMapProvider.BuildSiteMap() +1576
    System.Web.XmlSiteMapProvider.get_RootNode() +27
    System.Web.UI.WebControls.SiteMapDataSource.GetNodes() +566
    System.Web.UI.WebControls.SiteMapDataSource.GetTreeView(String viewPath) +51
    System.Web.UI.WebControls.SiteMapDataSource.GetHierarchicalView(String viewPath) +171
    System.Web.UI.HierarchicalDataSourceControl.System.Web.UI.IHierarchicalDataSource.GetHierarchicalView(String viewPath) +32
    System.Web.UI.WebControls.HierarchicalDataBoundControl.GetData(String viewPath) +74
    System.Web.UI.WebControls.Menu.DataBindItem(MenuItem item) +102
    System.Web.UI.WebControls.Menu.PerformDataBinding() +88
    System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect() +93
    System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +99
    System.Web.UI.WebControls.Menu.DataBind() +24
    System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +91
    System.Web.UI.WebControls.Menu.EnsureDataBound() +65
    System.Web.UI.WebControls.Menu.CreateChildControls() +101
    System.Web.UI.Control.EnsureChildControls() +138
    System.Web.UI.Control.PreRenderRecursiveInternal() +109
    System.Web.UI.Control.PreRenderRecursiveInternal() +233
    System.Web.UI.Control.PreRenderRecursiveInternal() +233
    System.Web.UI.Control.PreRenderRecursiveInternal() +233
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6948
    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +258
    System.Web.UI.Page.ProcessRequest() +31
    System.Web.UI.Page.ProcessRequest(HttpContext context) +99
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +401
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +117




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44

    This is still chinese to me. Can someone put this in laymans terms?
     
  8. I figured out the fix for this error all by myself. Woo-hoo.
     

Share This Page