我在使用表单标签的 asp.net 应用程序中有一个内容页面。页面上只有一个,所以我很困惑为什么它给我错误:验证(HTML5):元素'form'不能嵌套在元素'form'中
继承人的代码:
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" CodeBehind="Default.aspx.cs" Inherits="WebApplication6._Default" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="MainContent">
<div>
<form id="form1">
<asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="SqlDataSource1" AllowPaging="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Director" HeaderText="Director" SortExpression="Director" />
<asp:BoundField DataField="DateReleased" HeaderText="DateReleased" SortExpression="DateReleased" />
<asp:TemplateField HeaderText="Selection">
<ItemTemplate>
<asp:CheckBox ID="Selections" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged1" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [Movies]"></asp:SqlDataSource>
<asp:Button ID="Button1" runat="server" Text="Select Movies" OnClick="Button1_Click" CausesValidation="False" />
<asp:TextBox ID="TextBox1" Text="First Name" runat="server"></asp:TextBox>
</form>
</div>
</asp:Content>
我的母版页中有一个表格,但昨天没有给我带来问题..
有任何想法吗?