Click here to Skip to main content
15,886,787 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Server Error in '/DataReader' 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() +9646376
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.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

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929
Posted
Comments
[no name] 27-Jul-13 8:47am    
Well... your error message means that "A page can have only one server-side Form tag". What is your question and/or problem exactly?

The reason for this error is that your having more than one FORM tag in your aspx page with run at server attribute, which ASP.Net does not allow. You can have only one form tag in your aspx page with run at server attribute. So keep only one form tag in user aspx page to avoid this error.

If you run below aspx page you will get same error as it got two server form tag.
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
     <form id="form2" runat="server">
     </form>
</body>
</html>
 
Share this answer
 
yes if you have two forms in one page then it will throw error or if you must need ur two froms then you have to remove runat="server" this is same in master page also you put from tag in master page nd then also in .aspx page then there will be error definitely (:)
 
Share this answer
 
there are more than 1 forms tag in your page. Check them and remove the extra form element. Hopefully it will fix the issue.
 
Share this answer
 

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