PDA

View Full Version : این error چیه A page can have only one server-side Form tag



sasan123
سه شنبه 21 آبان 1387, 15:20 عصر
دوستان کسی می تونه بگه این error یعنی چی

A page can have only one server-side Form tag.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: A page can have only one server-side Form tag.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

kiosksoft
سه شنبه 21 آبان 1387, 15:24 عصر
دوست عزیز html این صفحه رو میشه بزاری.

ظاهرا یه کنترل وب استفاده کردی که داخل تک فرم نمی باشد . کنترل های وب باید در داخل تک
<form runat=server></form> بکار برده شوند.

sasan123
سه شنبه 21 آبان 1387, 15:41 عصر
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Nested.Default2" Title="Untitled Page" %>
<%@ Register TagPrefix="cc1" Namespace="MsdnMag" Assembly="NestedDataGrid" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<form id="Form1" method="post" runat="server">
<cc1:NestedDataGrid id="dataGrid" runat="server" autogeneratecolumns="false" cellpadding="2" cellspacing="0"
borderwidth="1" PageSize="12" gridlines="none" Font-Name="verdana" Font-Size="8pt" scrollchildren="false"
ExpandedItem="7" DataMember="sabad" RelationName="Customer2Orders" OnUpdateView="UpdateView">
<AlternatingItemStyle BackColor="Ivory"></AlternatingItemStyle>
<ItemStyle BackColor="#EEEEEE"></ItemStyle>
<HeaderStyle Font-Bold="True" BackColor="Khaki"></HeaderStyle>
<Columns>

<cc1:ExpandCommandColumn CollapseText="&lt;img border=no src=images/collapse.gif&gt;" ExpandText="&lt;img border=no src=images/expand.gif&gt;">
<ItemStyle Width="15px"></ItemStyle>
</cc1:ExpandCommandColumn>
<asp:BoundColumn DataField="ID" HeaderText="ID"></asp:BoundColumn>
<asp:BoundColumn DataField="Customer" HeaderText="Customer">
<ItemStyle Width="400px"></ItemStyle>
</asp:BoundColumn>
<asp:BoundColumn DataField="country" HeaderText="Country">
<ItemStyle Width="100px"></ItemStyle>
</asp:BoundColumn>
</Columns>
<PagerStyle NextPageText="4" Font-Size="150%" Font-Names="webdings" PrevPageText="3" Position="Top"></PagerStyle>
</cc1:NestedDataGrid>

</form>

kiosksoft
سه شنبه 21 آبان 1387, 15:54 عصر
از master page استفاده کرده اید ؟ نیازی به تگ form ندارید ... کد master page رو چک کنید