MasterPage ASP.Net Error

Associate
Joined
5 Apr 2003
Posts
1,420
Here's the error:


Server Error in '/WebSite1' Application.
--------------------------------------------------------------------------------

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) +654
System.Web.UI.Page.get_Master() +72
System.Web.UI.Page.ApplyMasterPage() +30
System.Web.UI.Page.PerformPreInit() +48
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1450




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210



In my default.aspx page i've put in: MasterPageFile="~MasterPage.master"

I'm not sure if i'm missing something else, does anyone know how i can fix this as its really annoying me!

Thanks, Sainte
 
Make sure you have a content place holder in the master page, and then in the default.aspx you just need the masterpage reference in the top (like you have) and a content placeholder thing that references the placeholder in the masterpage. You don't want the <html> tags in the default.aspx.
 
Back
Top Bottom