<!DOCTYPE html>
<asp:Content ID="content1" ContentPlaceHolderID="head" runat="server">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="gvapproveweekend" runat="server" BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" OnRowCommand = "OnRowCommand">
<Columns>
<asp:ButtonField ButtonType="Button" CommandName="Approve" Text="Approve" />
<asp:ButtonField ButtonType="Button" CommandName="Reject" Text="Reject" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlData" runat="server"></asp:SqlDataSource>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
</asp:Content>
我评论了Form标签并尝试执行但是收到此错误 “GridView'类型的控制'head_gvapproveweekend'必须放在带有runat = server的表单标记内。”
如果我为表格网格保留表单,则会抛出另一个错误“页面只能有一个服务器端表单标记。”
需要提前解决此问题的解决方案