Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys. I have been creating and rinning ASP.Net pages for the past 3 months but today I got this Error message from my page. Any Ideas whats up??

"Content controls have to be top-level controls in a content page or a nested master page that references a master page.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Content controls have to be top-level controls in a content page or a nested master page that references a master page.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[HttpException (0x80004005): Content controls have to be top-level controls in a content page or a nested master page that references a master page.]
System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +8669848
System.Web.UI.Page.get_Master() +51
System.Web.UI.Page.ApplyMasterPage() +15
System.Web.UI.Page.PerformPreInit() +45
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +282"
Posted

I bet this is on a page that you recently added to the site. You'll probably find that you didn't specify the master page to use for the page.
 
Share this answer
 
Comments
Anele Ngqandu 17-Sep-10 5:59am    
No Sir, I created a new project and I specified the master page to use, but still gives same results.
please check that is there any HTML tags or ServerControls is outside the ContentPlaceHolder. If yes then shift those inside the ContentPlaceHolder.
 
Share this answer
 
Comments
Anele Ngqandu 17-Sep-10 6:39am    
Hi well all my tags are correct, but intrestingly i got this error that says "A loop was detected in the master page file references."
senguptaamlan 17-Sep-10 6:53am    
check the hierarchy of the master pages (it seems that you have made a circular reference between your master pages).

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