Only content controls are allowed directly on the content page that contains content controls

I am trying to add the owner of the content site to the main page, but am getting the above error. The master page is inherited from another master page, and many of the ContentPlaceHolders of the child wizard are wrapped in content tags that insert content from the inheriting page into the place holders of the parent master. However, I want the child master to deviate a little from the base master, but have its own ContentPlaceHolder that is not associated with the parent master. However, it does not seem like the following line:

<asp:ContentPlaceHolder ID="chpBanner" runat="server" /> 
+4
source share
1 answer

It's impossible. This is not even logical. If you host an independent ContentPlaceHolder, how does the parent main page know where to put it?

How would he build a control tree if the parent was not attached to the controls?

You will need to select the ContentPlaceHolder in the parent to add it to.
If you do this for positioning purposes, you can use CSS to position the contents of this section, regardless of whether you want the page to display.

+5
source

Source: https://habr.com/ru/post/1432288/


All Articles