A page can have only one server-side Form tag

喜夏-厌秋 提交于 2019-12-04 18:24:04

ASP.NET Web Forms won't let you put more than one form tag in a page - your master page contains that form tag, so this:

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<form id="form1" runat="server">
   <div align="center">

will cause problems as it's trying to add a form tag. You don't need this form here anyways as the form tag in your master page is quite adequate.

<head runat="server">
    <title></title>
</head>
<body style="direction:rtl;width:100%;background-color:#808080">
    <form id="frmLevel2" runat="server">
        <div dir="ltr" style="width:1000px;">
            <asp:Button ID="btnExit" runat="server" OnClick="btnExit_Click" Text="خروج" />
        </div>
        <div>
            <asp:GridView ID="GVLevel2" runat="server" Font-Names="Times New Roman" Font-Size="9pt" Width="700px" AllowPaging="True" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Horizontal">
                <AlternatingRowStyle BackColor="#F7F7F7" />
                <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                <SortedAscendingCellStyle BackColor="#F4F4FD" />
                <SortedAscendingHeaderStyle BackColor="#5A4C9D" />
                <SortedDescendingCellStyle BackColor="#D8D8F0" />
                <SortedDescendingHeaderStyle BackColor="#3E3277" />
            </asp:GridView>
        </div>
        <div>
            <asp:Label ID="erorlabel" runat="server"></asp:Label>
            <asp:Label ID="lblresult" runat="server"></asp:Label>
        </div>
    </form>
</body>
</html>

My Error is " A page can have only one server-side Form tag. " too
i  don't have master page 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!