Click here to Skip to main content
15,891,673 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi,
I am getting this error "Only Content controls are allowed directly in a content page that contains Content controls".

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default1.aspx.cs" Inherits="_Default1" MasterPageFile="~/mainMasterPage.master" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="CSS/Style.css" type="text/css" rel="Stylesheet" />
</head>
<body dir="rtl">
    <form id="form1" runat="server">
    </form>
    <asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
       <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <cc1:DragPanelExtender ID="DragPanelExtender1" runat="server" DragHandleID="Panel7"
            TargetControlID="Panel6">
        </cc1:DragPanelExtender>
        <cc1:DragPanelExtender ID="DragPanelExtender2" runat="server" DragHandleID="Panel2"
            TargetControlID="Panel1">
        </cc1:DragPanelExtender>
        <cc1:DragPanelExtender ID="DragPanelExtender3" runat="server" DragHandleID="Panel5"
            TargetControlID="Panel4">
        </cc1:DragPanelExtender>
        <asp:Label ID="lblUser" runat="server" Text="Label"></asp:Label><br />
.
.
.
</asp:Content>
</body>
</html>




& MasterPage code:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="mainMasterPage.master.cs" Inherits="mainMasterPage" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>WaveLive</title>
<link rel="stylesheet" type="text/css"  href="CSS/reset.css"/>
<link rel="stylesheet" type="text/css" href="CSS/MainStyle.css" />
<link type="text/css" href="CSS/menu.css" rel="stylesheet" />
<script type="text/javascript" src="JScripts/jquery.js"></script>
<script type="text/javascript" src="JScripts/menu.js"></script>
<style type="text/css">
div#menu { margin:5px auto; }
</style>
</head>
<body>

<div id="wrap">
.
.
.
</div>
</body>
</html>




please help me.
Posted
Updated 1-Apr-12 0:28am
v2

Remove the below from your aspx page as you are using master page.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="CSS/Style.css" type="text/css" rel="Stylesheet" />
</head>
<body dir="rtl">
    <form id="form1" runat="server">
    </form>
 
Share this answer
 
HI ,
your Master page doesn't contain ContentPlaceHolder

ASP.NET
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="mainMasterPage.master.cs" Inherits="mainMasterPage" %>

<!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>
    <asp:ContentPlaceHolder id="head" runat="server">
    <link rel="stylesheet" type="text/css"  href="CSS/reset.css"/>
<link rel="stylesheet" type="text/css" href="CSS/MainStyle.css" />
<link type="text/css" href="CSS/menu.css" rel="stylesheet" />
<script type="text/javascript" src="JScripts/jquery.js"></script>
<script type="text/javascript" src="JScripts/menu.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
div#menu { margin:5px auto; }
</style>
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>
 
Share this answer
 
Make sure there are no errors in your web.config file.
It sometimes happens when you are referencing an assembly in web.config and it does not exists in the bin folder
e.g. AjaxToolKit.dll
 
Share this answer
 
Hi,

your page contains 'content' tag with lowercase you just replace that by 'Content'.
 
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