在ASP2.0中,三个分页分别调用同一个.Maseter文件后,总是出现错误,提示为:You can only have one <head runat="server"> control on a page.Server Error in '/Lab3' Application.
--------------------------------------------------------------------------------You can only have one <head runat="server"> control on a page.
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.Web.HttpException: You can only have one <head runat="server"> control on a page.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:
[HttpException (0x80004005): You can only have one <head runat="server"> control on a page.]
System.Web.UI.HtmlControls.HtmlHead.OnInit(EventArgs e) +177
System.Web.UI.Control.InitRecursive(Control namingContainer) +456
System.Web.UI.Control.InitRecursive(Control namingContainer) +268
System.Web.UI.Control.InitRecursive(Control namingContainer) +268
System.Web.UI.Control.InitRecursive(Control namingContainer) +268
System.Web.UI.Control.InitRecursive(Control namingContainer) +268
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint
问如何解决?
--------------------------------------------------------------------------------You can only have one <head runat="server"> control on a page.
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.Web.HttpException: You can only have one <head runat="server"> control on a page.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:
[HttpException (0x80004005): You can only have one <head runat="server"> control on a page.]
System.Web.UI.HtmlControls.HtmlHead.OnInit(EventArgs e) +177
System.Web.UI.Control.InitRecursive(Control namingContainer) +456
System.Web.UI.Control.InitRecursive(Control namingContainer) +268
System.Web.UI.Control.InitRecursive(Control namingContainer) +268
System.Web.UI.Control.InitRecursive(Control namingContainer) +268
System.Web.UI.Control.InitRecursive(Control namingContainer) +268
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint
问如何解决?
只保留.master页中的<head runat="server">或者把.master页中的<head runat="server">删掉试试
而去調用的頁面也有 <head runat="server"> 所以提示为:You can only have one <head runat="server">