Only Content Controls are Allowed (C# webcontrols)

khikho

New Member
So, I'm not sure what's going on. My boss wasn't pleased with me using MVC and Razor, so I'm being forced to code with this nasty webcontrol/codebehind style. =/The error is:\[code\]Only Content controls are allowed directly in a content page that contains Content controls.\[/code\]Here is the masterpage:\[code\]<%@ Master Language="C#"%><!DOCTYPE html><html><head> <title>Application Form</title></head> <body> <div id="container"> <asp:contentplaceholder id="contentPlaceHolder" runat="server" /> </div></body></html>\[/code\]And here is the Default.aspx page that's throwing the error.\[code\]<%@ Page Language="C#" Inherits="dumb.Default" MasterPageFile="MasterPage.master" %><h2>Application Form</h2><asp:Content id="content" ContentPlaceHolderID="contentPlaceHolder" runat="server"> <p>Please complete this application.</p> <form action="Default.aspx" method="post" runat="server"> <div> <span class="spaced">Name:</span><asp:TextBox id="name" runat="server" /> </div> </form> <p> <asp:Label id="finalmessage" runat="server" /> </p></asp:Content>\[/code\]And the silly Default.aspx.cs codebehind...using System;using System.Web;using System.Web.UI;\[code\]namespace dumb{ public partial class Default : System.Web.UI.Page { protected void Page_Load (object sender, EventArgs e) { if (IsPostBack) { finalmessage.Text = "Submission Processed Successfully!"; } } }}\[/code\]
 
Back
Top