Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Ajax Masterpage
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 7-Dec-10 17:19pm
Edited 1-Apr-12 0:28am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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>
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

HI ,
your Master page doesn't contain ContentPlaceHolder
 
<%@ 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>
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi,
 
your page contains 'content' tag with lowercase you just replace that by 'Content'.
  Permalink  

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



Advertise | Privacy | Mobile
Web03 | 2.8.141022.2 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100