尝试在 localhost 上运行我的项目时出现此错误
异常详细信息:System.Web.HttpException:一个页面只能有一个服务器端 Form 标签
这是我的ASP.NET
表格
<form id="consultationform" runat="server">
<%-- Consultation --%>
<%-- Name --%>
<asp:Label ID="namelabel" runat="server" Text="Name"></asp:Label>
<asp:TextBox ID="namebox" runat="server"></asp:TextBox><br />
<%-- email --%>
<asp:Label ID="emaillabel" runat="server" Text="Email"></asp:Label>
<asp:TextBox ID="emailbox" runat="server"></asp:TextBox><br />
<%-- restaurant --%>
<asp:Label ID="restaurantlabel" runat="server" Text="Restaurant"></asp:Label>
<asp:TextBox ID="restaurantbox" runat="server"></asp:TextBox><br />
<%-- Address --%>
<asp:Label ID="addresslabel" runat="server" Text="Address"></asp:Label>
<asp:TextBox ID="addressbox1" runat="server"></asp:TextBox><br />
<asp:TextBox ID="addressbox2" runat="server"></asp:TextBox><br />
<asp:TextBox ID="addressbox3" runat="server"></asp:TextBox><br />
<%-- County --%>
<asp:Label ID="countylabel" runat="server" Text="County"></asp:Label>
<asp:DropDownList ID="countrydropdown" runat="server"
DataSourceID="CountySqlDataSource" DataTextField="CountyName"
DataValueField="CountyName" AppendDataBoundItems="True" AutoPostBack="True">
<asp:ListItem Value="" Text="Select a County"></asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="CountySqlDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [CountyName] FROM [Counties]"></asp:SqlDataSource>
<br />
<%-- Telephone --%>
<asp:Label ID="telephonelabel" runat="server" Text="Telephone"></asp:Label>
<asp:TextBox ID="telephonebox" runat="server"></asp:TextBox><br />
<%-- Calendar --%>
<asp:Label ID="datelabel" runat="server" Text="Date (What suits you?)"></asp:Label><asp:Calendar
ID="Calendar1" runat="server"></asp:Calendar><br />
<%-- Additional Info --%>
<asp:Label ID="infolabel" runat="server" Text="Additional Information (That may help us further)"></asp:Label><br />
<asp:TextBox ID="infobox" runat="server"></asp:TextBox><br />
<%-- Menu Upload --%>
<asp:Label ID="menulabel" runat="server" Text="Menu"></asp:Label><asp:FileUpload
ID="FileUpload1" runat="server" /><br />
<%-- Book Button --%>
<asp:Button ID="bookbtn" runat="server" Text="Book Now" />
</form>
我不明白为什么会这样。我在页面上只有一个表单标签。非常感谢您对此事的任何帮助。
form
应该注意,如果我删除标签,页面会完全呈现。