Click here to Skip to main content
15,901,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Server Error in '/Web' 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:
C#
[HttpException (0x80004005): A page can have only one server-side Form tag.]
   System.Web.UI.Page.OnFormRender() +89
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +51
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +43
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +335
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +74
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +291
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +49
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +56
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +234
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +53
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +98
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +43
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +335
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +74
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +291
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +49
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +56
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +234
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +53
   System.Web.UI.Control.Render(HtmlTextWriter writer) +31
   System.Web.UI.Page.Render(HtmlTextWriter writer) +39
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +74
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +291
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +49
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5542
Posted
Updated 13-Nov-11 23:49pm
v2

Hi gpaantony,
I think your webform conists of 2 <form> tags.Remove the unnecessary one.
I hope it clears your problem.
 
Share this answer
 
v2
Comments
Prince Antony G 14-Nov-11 6:25am    
thanks for ur reply
hi,
In your web page have two form like this
<pre lang="c#"><pre><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title></head>
<body>
<form id="form1" runat="server">
<div> </div>
</form>
<form id="form2" runat="server">
<div> </div>
</form>
</body>
</html></pre></pre>So you are getting "A page can have only one server-side Form tag. " error message so just remove one runat="server" from any one of form tag.

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title></head>
<body>
<form id="form1" >
<div> </div>
</form>
<form id="form2" runat="server">
<div> </div>
</form>
</body>
</html>
If you want only one form tag ,remove unwanted form tag.
 
Share this answer
 
v2
Comments
Bharath Balu 6-Sep-14 8:32am    
Thank you so much for the answer. I too had a same problem and solved. Thanks a lot.
"A page can have only one server-side Form tag."

There is more than one form marked with "run at server" on your ASP page. This is obviously not allowed. So the compiler tells you so. It seems you're not listening intently though.

Cheers!

—MRB
 
Share this answer
 
Comments
Prince Antony G 14-Nov-11 6:25am    
thanks for ur reply
dotnetcode2009 14-Nov-11 6:47am    
hai wt r doing u?
 
Share this answer
 
Comments
Prince Antony G 14-Nov-11 6:25am    
thanks for ur reply
You somehow ended up with two form tags in a page.
http://forums.asp.net/t/1734913.aspx/1[^]
Google[^] for more.
 
Share this answer
 
Comments
Prince Antony G 14-Nov-11 6:25am    
thanks for ur reply

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900