Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
Content controls have to be top-level controls in a content page or a nested master page that references a master page.

a master page.
what is the meaning of this error. i am unable to resolve it.
Posted

1 solution

Place your asp/HTML controls inside the ContentPlaceholder of the Page . Your page should look like this

ASP.NET
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebUI._Default" MasterPageFile="~/Site1.Master" %> 

<asp:Content runat="server" ID="head" ContentPlaceHolderId="head"> <!-- stuff you want in >head%lt; --> </asp:Content>  <asp:Content runat="server" ID="content" ContentPlaceHolderId="ContentPlaceHolder1"> 
<h1>Your content</h1> 

</asp:Content> 
 
Share this answer
 
v2
Comments
mistiarora 4-Jul-12 7:39am    
in master mage or aspx page???
mistiarora 4-Jul-12 7:40am    
when m using ContentPlaceholder in aspx page it give error
bbirajdar 4-Jul-12 8:01am    
Your page content should look like this

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebUI._Default" MasterPageFile="~/Site1.Master" %> <asp:content id="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> This is the body!

You missed to include this in the Page - MasterPageFile="~/Site1.Master"
mistiarora 4-Jul-12 8:06am    
hey hey can i ask one question to you.
mistiarora 4-Jul-12 8:09am    
arey yar mujhe ye batao <html> tag kahan jayega head me ya contentplaceholder1 me ?

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