在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
 问如何解决?
 

解决方案 »

  1.   

    从提示中看就是<head runat="server">在同一个页面中出现了多次
    只保留.master页中的<head runat="server">或者把.master页中的<head runat="server">删掉试试
      

  2.   

    是否是.Maseter有 <head runat="server"> 
    而去調用的頁面也有 <head runat="server"> 所以提示为:You can only have one <head runat="server">
      

  3.   

    先谢谢上面的回复,是的,在.Master中和去调用的页面中都有<head runat="server">,我删掉其中一个试试
      

  4.   

    试过了,谢谢,已经解决掉了,将.Master中的<head runat="server">中的runat="server"删除即可实现多次调用,谢谢