ERROR Content controls have to be top-level controls in a content page or a nested master page that references a master page.

This all used to work until about 5 minutes ago. Did I change something? For some reason I am now getting this error:

 

Content controls have to be top-level controls in a content page or a nested master page that references a master page.

 

What I have:

 
I have a masterpage inside of a directory. That directory is a first level directory with its own web.config file....The whole thing is protected by the web.config file above it (in the main public directory).

 That main public directory has a masterpage as well. I am not currently linking the two masterpages together becuase a.) I never did before and they worked just fine. and b.) They have a lot of the same stuff in each one. I don't know maybe causes redundancy.

 
Does anyone have a clue why I'm getting this error? Thanks.


 

0
jbassett
1/31/2008 5:25:56 PM
asp.net.navigation-controls 13714 articles. 0 followers. Follow

2 Replies
1720 Views

Similar Articles

[PageSpeed] 55

The 2 reasons could be .Either you accidently put something in your content page above the content tag or the masterpages are linked and the child master page  has some content outside the content tag. Take a close look at it.Especially since you say that it was working before, must be something simple.If you have some source control utility try a comparison between versions to find out the culprit


Jeev
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
0
Jeev
1/31/2008 5:40:52 PM

My mistake. Thank you for pointing it out.

 I must have re-made the default.aspx file because it's "an entire html file" instead of a page attached to the masterpage file.

 
So....anyone reading this don't forget when you create a page that you want tied to a masterpage file.....Make sure you click the checkbox "select a masterpage" when you create it.

 

Thanks for your help Jeev
 

0
jbassett
1/31/2008 5:51:04 PM
Reply:

Similar Artilces:

Error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.
when I make a directory on my root, and in that directory I put a masterpage and a web form ... I get always an error : Content controls have to be top-level controls in a content page or a nested master page that references a master page.   Does somebody know what the problem is ? Is it possible you can't set a masterpage in a directory ... ?Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) i've founded ... I had to nest my masterpage ...Kind Regards,Joeri Pansaerts.From Bruges, Belgium :) Hi Joeri Pansaerts, I am receiving the same error as the one posted her...

Content controls have to be top-level controls in a content page or a nested master page that references a master page.
Why in the world am I getting this error? The solutions I have seen either don't apply or don't work.  Here is my master page code:<%@ Master Language="C#" AutoEventWireup="false" CodeFile="TechLMSMasters/MainSide.master.cs" Inherits="MainSide" %> <%@ Register TagPrefix="usercontrol" TagName="Search" Src="~/library/uc/Search.ascx" %> <%@ Register TagPrefix="usercontrol" TagName="UserName" Src="~/library/uc/UserNameDisplay.ascx" %><!DOCTYPE html PUBLI...

Error:Content controls are allowed only in content page that references a master page?!!
 Hello All I have a web application, it is working well in localost without any error but when I upload it to the host it show me the error below:Any suggestion? I have not seen this error beforePlease any helpRegards, Server Error in '/' Application. Content controls are allowed only in content page that references a master page. Description: Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code. Ex...

error: Content controls are allowed only in content page that references a master page.
 I have a website that uses a masterpage. most of my users have no problem; but few get the error bellow. I was never able to duplicate the error.   ex.message: Content controls are allowed only in content page that references a master page.Stack trace:    at System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection)   at System.Web.UI.Page.get_Master()   at System.Web.UI.Page.ApplyMasterPage()   at System.Web.UI.Page.ProcessRequestMain(Boolean in...

Problem to use TreeView Control in a 'content page' This Error Occur "Only Content controls are allowed directly in a content page that contains Content controls."
hi I am trying to use the TreeView Control inside the content page (Page that has a master page is a content page). On compiling the project I got the following ASP.Net runtime error: "Only Content controls are allowed directly in a content page that contains Content controls."B@b@R J Issue resolved. I was putting script tag in the content page that is not allowed. when remove the script from content page problem is resolved.B@b@R J...

Content controls are allowed only in content page that references a master page.
HiI'm getting the above error with my application.Basically I had a master file and then some page files referencing the master file.In the page files I had some ajax controls so had :<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><atlas:ScriptManager ID="ScriptManager1" runat="server"></atlas:ScriptManager>in them.but when I try adding an ajax control to the master file and putting the above code in, it shows the error messagewhy would this be?thanks!  Make sure you have prop...

Show content in both Master Page ContentPlaceholder AND Content Page Content control
I note that by default or rendering rules, when you add content/controls to the Content Page ASP:Content control matched to a Master Page ContentPlaceholder, any content/controls in the matching Master Page ContentPlaceholder is not displayed. Is there a setting that can be made to merge or show both content/controls in the Master Page ContentPlaceholder and content/controls in the matching Content Page Content control? Thanks         Don't think so. If you specify a content control in your page then whatever is in there displays and anything in the...

Need to access a Label Control on the Master Page from a user control attached to a content page
Hello all, I have a master page (say  site.master)  with a status Label in it. I have a content page ( say content.aspx)  that has a user control (say usercontrol.ascx). One of the Button Click Events in the usercontrol.ascx needs to pass on some text onto the status label on the masterpage(LabelStatusMsg) and display it. I have been able to do this directly off a content page (content.aspx) by using the following code (VB)  on the master page <%@ MasterType virtualpath="~/site.master" %> and Dim mpLabel As Label = CType(Master.FindControl("LabelStatusMsg"),...

Error finding the user control in master page from content page
HI, I have a master page in which i have created a header which is a user control into which contains a label.  I a accessing this label from content page.  The code for the following is mentioned below.  Sometimes it works perfectly fine however sometimes it throws object reference error.  So my application is not stable.   Any suggestions what could be the possible issue???????     Utils UT = new Utils();    protected void Page_Load(object sender, EventArgs e)    {      Sys...

HELP..... Master Page Error (The page has controls that require a Master Page, but none is specified.)
Hi, I had almost finished creting my master page to use as a template for all future internal applications.  I had created a template to use in creatign new applications and had sucessfully created a new project based upon the MasterPage template... All was working well when I noticed a small graphic inconsistancy on the MasterPage... I reopened the MasterPage and I got teh above error message... I have looked at the HTML and everything seems to be okay and there including the header lines... <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits=&qu...

convertion from page to content page or from user control to content page
Hi, I have converted an asp.net 1.1 application to 2.0.  Now what I am looking for some enhancement.  I added a master page and now I want to add other pages as content pages. but those pages which I am converting into content have some user control. Now either I can convert those user control to content pages ( which i want to look for if it is possible),  Or I am thinking i shouldn't convert those user control to content pages cause they might be just good. So looking for some of those people opinion who have worked through this so can I get opinion here please.thanks&nb...

Accessing a master page's control in a nested content Page(Urgent)
Hi all, I have a masterpage rm_master.masterand another masterpage rm_sub.master which inherits from rm_master.master. Now I want to access a dropdownlist control in a content page which derieves from rm_select_master. the code i used wasDropDownList DropDownList1 = (DropDownList)Master.FindControl("DropDownList1");string a; a = DropDownList1.Text;   The error i got was "Object reference not set to an instance of an object". Please help.. Thanks in advance.. Bharath You can try Page.FindControl or use the mastertype directivePlease remember to click “...

Trigger a control in Master from control in content page?
Hi!So how can I trigger the button click (or change hidden field?) in Master page from the button click event in content page? I need that because I have a popupcontrol in master page. I set it like this to have a "Add to cart" functionality - the button is in content page and the cart (popup) is in master. Like in gap.com... Been trying to figure that one out for days..  hiif you want to access a control which is in the master page from a client page..then you write a code like thisImageButton imgButton = (ImageButton)Master.FindControl("imageStep4");imgButto...

Content page accessing master page controls?
I'm probably that much of a noob that I've deviated from the path authors of ASP.NET 2.0 thought of how master and content pages should off been used... Looking from the outside it seemed logical to me that (even on this website) a search text box should be part of a master page and a page that displays results should be a content page... So the problem I'm having (if my hunch about that search textbox control in the header of say even this very website being part of a master page, and result page that subsequently loads underneath the header after you click go bei...

Web resources about - ERROR Content controls have to be top-level controls in a content page or a nested master page that references a master page. - asp.net.navigation-controls

European Terrestrial Reference System 1989 - Wikipedia, the free encyclopedia
The European Terrestrial Reference System 1989 ( ETRS89 ) is a ECEF (Earth-Centered, Earth-Fixed) geodetic Cartesian reference frame , in which ...

Microsoft dismisses iPad Pro as “a companion device” and references old Steve Jobs stylus quote
... to be a companion device.” Laycock also said that “at one point in time, Apple declared that if there’s a stylus, that’s failure” – a reference ...

New York Times Removes Reference to President Obama and Cable News
... — Noah Rothman (@NoahCRothman) December 18, 2015 The Times story was published Thursday, but by Friday morning, the reference to cable news ...

Can you spot these classic film references hidden in Pixar movies?
The animators at Pixar definitely love to throw in allusions to some of their favorite movies in their own films. Vimeo user Jorge Luengo Ruiz ...

Here's how to remove all Donald Trump references when you're online
... screen, a new Google Chrome extension can help. Here's how the Trump Filter works. The extension " searches the web pages you visit for references ...

See The Classic Movie References Found In Pixar's Greatest Films
... all well aware of just how clever Pixar movies are. These emotionally engaging stories are full of intricate themes and crammed with references ...

Zootopia Trailer Adds a Godfather Reference to Disney Film - Collider
Watch a new trailer for the Disney animated movie Zootopia, which takes place in a world inhabited by talking animals and features Jason Bateman ...

Hillary Clinton Ends Democratic Debate With A Star Wars Reference
The other day, President Obama ended his White House press conference with a reference to The [...]

Review: Klipsch X20i Reference In-Ear Headphones
These Klipsch X20i Reference In-Ear Headphones are pretty darn fantastic, and worth every penny.`

O’Malley References How Old Clinton And Sanders Are While Explaining His ISIS Strategy
O’Malley References How Old Clinton And Sanders Are While Explaining His ISIS Strategy

Resources last updated: 1/16/2016 12:41:07 AM