When i use <atlas:ScriptManager> tag in .aspx or .ascx pages without <head runat =server> , i get the following
error. Is this a bug or as designed?
Server Error in '/AtlasWebSite' Application.
Must have a <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: Must have a <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: Must have a <head runat="server">]
Microsoft.Web.UI.ScriptManager.OnPreRender(EventArgs e) +262
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
But i am not using any themes in my website which is fairly simple ASP.NET 2.0 impelementation. Infact i am using Atlas in .ascx control and .ascx control is loaded first then the page, as a result scripmanager is unable to see the <head runat=server> tag
and generates this error.
no it isn't. If you're using Themes in ASP.NET 2.0 it's required to have that attribute.
Grz, Kris.
Ok, but i'm not using themes and I still go that message. I don't know if it matters, but my scriptmanager control resides in a content page as opposed to the master page.
i believe that the head element must be a server element since it's one of the sections that is sent back from the server to the client during a partial postback (ie, it's contents are parsed and send on every partial postback response).
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
leoguy
Member
122 Points
59 Posts
Must have a Error
Mar 02, 2006 02:59 PM|LINK
When i use <atlas:ScriptManager> tag in .aspx or .ascx pages without <head runat =server> , i get the following error. Is this a bug or as designed?
Server Error in '/AtlasWebSite' Application.
Must have a <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: Must have a <head runat="server">
Source Error:
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Aidy
Contributor
3585 Points
711 Posts
Re: Must have a Error
Mar 02, 2006 03:31 PM|LINK
LordHits
Member
520 Points
104 Posts
Re: Must have a Error
Mar 02, 2006 03:31 PM|LINK
XIII
All-Star
175992 Points
21431 Posts
ASPInsiders
Moderator
MVP
Re: Must have a Error
Mar 02, 2006 03:42 PM|LINK
Hi,
no it isn't. If you're using Themes in ASP.NET 2.0 it's required to have that attribute.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
leoguy
Member
122 Points
59 Posts
Re: Must have a Error
Mar 02, 2006 03:50 PM|LINK
But i am not using any themes in my website which is fairly simple ASP.NET 2.0 impelementation. Infact i am using Atlas in .ascx control and .ascx control is loaded first then the page, as a result scripmanager is unable to see the <head runat=server> tag and generates this error.
Any clue?
LordHits
Member
520 Points
104 Posts
Re: Must have a Error
Mar 02, 2006 04:15 PM|LINK
Ok, but i'm not using themes and I still go that message. I don't know if it matters, but my scriptmanager control resides in a content page as opposed to the master page.
gbecavin
Member
30 Points
6 Posts
Re: Must have a Error
Jun 01, 2006 08:59 PM|LINK
Hi,
I had the same problem. An .aspx page with a placeholder, loading an ascx control in code behind.
I replace the <head> section in my aspx page with <head id="headSection" runat="server" >, and now it works.
As the ascx control had an updatepanel, i had to do the loadcontrol in the page-init method.
Hope that will solve your pb.
Gilles
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Must have a Error
Jun 01, 2006 10:07 PM|LINK
hello guys.
i believe that the head element must be a server element since it's one of the sections that is sent back from the server to the client during a partial postback (ie, it's contents are parsed and send on every partial postback response).
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
ullaskumar_v
Member
9 Points
3 Posts
Re: Must have a Error
Oct 11, 2006 06:00 AM|LINK
Hi,
If you are using Master pages.. then have to make sure that <head runat="server"> is there in the master page.
regards,
ukv
eryn
Member
5 Points
10 Posts
Re: Must have a Error
Mar 07, 2008 09:14 AM|LINK
I'm spitting out the page via xml, so I can't add the runat="server" at design time, is there some way I can add it in the OnPreInit method maybe??