A page can have only one server-side Form tag. ซึ่งผมมี <form> เดียว แบบนี้ควรแก้ไขอย่างไรครับ?
Error
Server Error in '/' Application.
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.
Stack Trace:
[HttpException (0x80004005): A page can have only one server-side Form tag.]
System.Web.UI.Page.OnFormRender() +9704972
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +35
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
System.Web.UI.Control.Render(HtmlTextWriter writer) +10
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
System.Web.UI.WebControls.TableCell.RenderContents(HtmlTextWriter writer) +31
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.WebControls.Table.RenderContents(HtmlTextWriter writer) +211
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +102
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1386
Tag : .NET, Web (ASP.NET)
Date :
2015-03-04 20:35:07
By :
natsk8
View :
1891
Reply :
6
ไม่เชื่อครัชว่ามีอันเดียว
compiler มันก็ฟ้องอยู่เห็นๆ
ไม่แน่ว่าคุณอาจจะหมกเม็ด </form> ไว้หลายๆอันก็ได้
Date :
2015-03-05 01:50:46
By :
DOG{B}
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title runat="server">Back-End</title>
</head>
<body>
<form id="form1" method="post" runat="server">
<asp:Table runat="server" ID="Table1" Height="700px" Width="807px" BorderWidth="2" CellPadding="2" CellSpacing="2">
<asp:TableRow Height="80px" runat="server">
<asp:TableCell runat="server"><h2 style="margin-left:300px ; border-width:2px">Back-End</h2></asp:TableCell>
</asp:TableRow>
<asp:TableRow VerticalAlign="Top" runat="server">
<asp:TableCell BorderWidth="2" runat="server">
<asp:DynamicHyperLink runat="server" ID="hyper_home" Text="Home" NavigateUrl="?page=home"></asp:DynamicHyperLink>
<asp:TreeView ExpandDepth="1" runat="server" ID="tree1">
<Nodes>
<asp:TreeNode Text="View Data">
<asp:TreeNode Text="View Country" NavigateUrl="?page=view"></asp:TreeNode>
<asp:TreeNode Text="View Tourism"></asp:TreeNode>
<asp:TreeNode Text="View News"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Add Data">
<asp:TreeNode Text="Add Country" NavigateUrl="?page=add"></asp:TreeNode>
<asp:TreeNode Text="Add Tourism"></asp:TreeNode>
<asp:TreeNode Text="Add News"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Edit Data">
<asp:TreeNode Text="Edit Country" NavigateUrl="?page=editCountry"></asp:TreeNode>
<asp:TreeNode Text="Edit Tourism" NavigateUrl="?page=editTour"></asp:TreeNode>
<asp:TreeNode Text="Edit News" NavigateUrl="?page=editNews"></asp:TreeNode>
<asp:TreeNode Text="Edit Prohibition" NavigateUrl="?page=editPro"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Delete Data">
<asp:TreeNode Text="Delete Country" NavigateUrl="?page=delete"></asp:TreeNode>
<asp:TreeNode Text="Delete Tourism"></asp:TreeNode>
<asp:TreeNode Text="Delete News"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</asp:TableCell>
<asp:TableCell BorderWidth="2" Width="300" VerticalAlign="Top" runat="server">
<asp:Panel runat="server" ID="hplContainer"></asp:Panel>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</form>
</body>
</html>
ไม่มีนะครับ
Date :
2015-03-05 03:43:37
By :
natsk8
เรียกใช้ไฟล์อื่น ๆ แล้วมีการ สร้าง <form> ในไฟล์อื่น ๆ อีกหรือเปล่าครับ
Date :
2015-03-05 07:07:14
By :
mr.win
น่ะดิเอา code ที่ให้ไปรันดูมันก็ปกติดีไม่เอ๋อหรอดังที่กล่าวเบย
Date :
2015-03-05 08:50:01
By :
DOG{B}
ได้แล้วครับ ตามที่คุณ Mr.win บอกเลยครับ ขอบคุณมากครับ
แล้วก็ขอบคุณ DOG{B} เช่นกันครับ
Date :
2015-03-05 13:27:58
By :
natsk8
Date :
2015-03-05 17:38:33
By :
mr.win
Load balance : Server 03