I have a server control that has a PlaceHolder, which is InnerProperty. In the class when rendering, I need to get the text / HTML content that should be in PlaceHolder. Here is an example of what the external code looks like:
<tagPrefix:TagName runat="server">
<PlaceHolderName>
Here is some sample text!
</PlaceHolderName>
</tagPrefix:TagName>
All this works fine, except that I don’t know how to get the content. I do not see any rendering methods open by the PlaceHolder class. Here is the code to manage the server.
public class TagName : CompositeControl
{
[TemplateContainer(typeof(PlaceHolder))]
[PersistenceMode(PersistenceMode.InnerProperty)]
public PlaceHolder PlaceHolderName { get; set; }
protected override void RenderContents(HtmlTextWriter writer)
{
}
}
Any ideas? Thanks in advance.
source
share