You can only have one <head runat=”server”> control on a page...

Problem

You get this error when running your application:

Server Error in XXX Application.

You can only have one <head runat=”server”> control on a page.

Description: An unhandled exception occurred during the handling 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.Web.HttpException: You can only have one <head runat=”server”> control on a page.

Source Error:

Information regarding the origin and location of the exception can be identified using the exception stack trace below.

This error occurs when the ASPX page has one or more missing tags, such as <head>, <body> or <form>.  Most likely, your HTML layout page file is damaged.

Solution

If an ASPX page is responsible for the error, inspect the associated HTML layout page in Iron Speed Designer or in an external HTML editor and repair the damage so that it conforms to the HTML syntax and, where appropriate, ASPX syntax.  Ensure that the HTML layout page has appropriate <doctype>, <html>, <head>, <body> and <form> tags.

If an ASCX control is responsible for the error, ensure that the ASCX control does NOT have <doctype>, <html>, <head> and <body> tags.  The presence of these tags will conflict with the page in which the ASCX control is embedded, causing this error to occur.  For guidance, compare your ASCX control file with those generated directly by Iron Speed Designer, such as the Sign In control (SignIn_Control.ascx).

See Also

Part VII:  Troubleshooting Applications

Application Won’t Run

Application Runs But No Data is Displayed

Application Error Messages