문제

I want to do something like this:

I got this User Control called Base:

<div>
some content...

<asp:ContentPlaceHolder id="baseContentPlaceHolder" runat="server"></asp:ContentPlaceHolder>

</div>

Then i inherit the Base in another User Control and add stuff to the content:

<asp:Content id="subBase" contentplaceholderid="baseContentPlaceHolder" runat"server">
    stuff to be added...
</asp:Content>

Is it possible to do with ContentPlaceHolder ?

How can this behavior be solved?

도움이 되었습니까?

해결책

I don't think you can do that.

A ContentPlaceHolder can only go in the MasterPage itself.

In the pages that inherit from the MasterPage, you put in a Content tag.

My best guess would be to add in a PlaceHolder, expose that on the control, and then add in your stuff to that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top