表现:
当然也可能是另外一个什么控件必须放置在Form里边。
原因:
如果是普通情况,当然直接加一个Form就可以了,但如果是使用了master page,这个错误的真正原因是在master page中 ContentPlaceHolder被错误放置到<form>外面了:
<form id="form1" runat="server">
<asp:LinkButton ID="PB" runat="server"><b>P</b>roduct Backlog</asp:LinkButton>
<asp:LinkButton ID="SB" runat="server"><b>S</b>print Backlog</asp:LinkButton>
</form>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder id="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>
改为:
<form id="form1" runat="server">
<asp:LinkButton ID="PB" runat="server"><b>P</b>roduct Backlog</asp:LinkButton>
<asp:LinkButton ID="SB" runat="server"><b>S</b>print Backlog</asp:LinkButton>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder id="ContentPlaceHolder2" runat="server">
</asp:ContentPlaceHolder>
</form>
一切正常。
本文转自火星人陈勇 51CTO博客,原文链接:http://blog.51cto.com/cheny/1098160