Click here to Skip to main content
15,861,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Server Error in '/incometax' 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.
Posted

The page for which you are getting this error must have defined a master page for itself in it's Page attributes: MasterPageFile="~/MasterPage.master"
Once you do it, your aspx should have a Content page such that master page can use it while rendering. Your page design here does not have any content panel in it.

Two options:
1. Remove page attribute for master page. => remove MasterPageFile="~/MasterPage.master" OR
2. Add Content control in your Declaration_Form.aspx. Add you page design in that content. (If needed, you can refer the design of content page looking at other pages.)

Read all about them here: MSDN: ASP.NET Master Pages[^]
 
Share this answer
 

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