| | |
Error in asp net
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
This can happen if you are using master pages and you have a
Master Page:
Note in the above example the content place holder is inside the
Resulting in:
Here is an example of two embedded forms causing that error without using master pages:
<form runat="server"> element in your master page and in your web content page you have another <form runat="server"> . Here is an example.Master Page:
asp.net Syntax (Toggle Plain Text)
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="daniweb.web.Site1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <link rel="stylesheet" href="Stylesheet1.css" type="text/css" /> <title>Master Page</title> <asp:ContentPlaceHolder ID="head" runat="server"> </asp:ContentPlaceHolder> </head> <body> <form id="form1" runat="server"> <center> <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder>
Note in the above example the content place holder is inside the
<form> element. Now on your child page: asp.net Syntax (Toggle Plain Text)
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Page1.aspx.cs" Inherits="daniweb.web.Page1" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <form id="hello" runat="server"> <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" OnClientClick="javascript:self.close(); " /> </form> </asp:Content>
Resulting in:
[HttpException (0x80004005): A page can have only one server-side Form tag.] Here is an example of two embedded forms causing that error without using master pages:
asp.net Syntax (Toggle Plain Text)
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="daniweb.web.Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <form id="form2" runat="server"> <p>hello</p> </form> </div> </form> </body> </html>
Last edited by sknake; Jul 2nd, 2009 at 3:20 pm.
•
•
Join Date: Jun 2009
Posts: 124
Reputation:
Solved Threads: 11
•
•
•
•
A page can have only one server-side Form tag
Please check your markup, you must have more than one form tags written there.
![]() |
Similar Threads
- ASP.Net perm full time programmer wanted (Web Development Job Offers)
- Front-End Developer with ASP.net needed!!! (Web Development Job Offers)
- Experience ASP.net with C# developer needed!! (Web Development Job Offers)
- ASP.Net / C# Web Developer (Web Development Job Offers)
- ASP.Net YAF Application Error (ASP.NET)
- ASP.Net Error with C# Coding (C#)
- "No Servers are available" Error with ASP.NET Webpage (Networking Hardware Configuration)
Other Threads in the ASP.NET Forum
- Previous Thread: selected detail info
- Next Thread: asp.net stylesheet
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax appliances asp asp.net beginner box browser businesslogiclayer button c# c#gridviewcolumn cac checkbox child class compatible complex confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datalist deadlock deployment development dgv dialog dropdown dropdownmenu dynamic edit embeddingactivexcontrol feedback fileuploader findcontrol flash flv folder form forms grid gridview homeedition hosting iis image index javascript jquery languages list maps menu mobile mssql multistepregistration nameisnotdeclared novell objects order problem profile ratings refer relationaldatabases response.redirect rotatepage search security serializesmo.table sessionvariables silverlight sql ssl tracking treeview typeof update validatedate validation vb.net virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopment wizard xml






