2010-08-26 21 views
0

在我的应用我收到此错误:asp.net中的标头标记错误?

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 control on a page.

可能是什么问题呢?

+1

邮政堆栈跟踪,以及哪个控件导致此错误? – CoderHawk 2010-08-26 11:21:27

回答

2

假设您有<head runat="server">标签的问题,您使用的母版页...

如果您使用的母版页,不要使用<head runat="server">子页面内...你可以添加必要的头标签

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content>

,如果你没有任何母版页做,然后确保<head runat="server">变量是不重复的。

+0

@sany正好我解决了问题谢谢你的回复 – 2010-08-26 11:34:23

+0

@Surya - 很高兴它帮助:) – CoderHawk 2010-08-26 11:36:39

0

你的网页上有多个<form runat="server">标签?你只能有其中之一。

+0

雅我解决了这个问题,其实两个

现在它正在工作谢谢你的回复 – 2010-08-26 11:30:27