Literal content is not allowed within a UserControl

.net, asp.net, c#, user-controls

Solution

[PersistChildren(false)]
[ParseChildren(true, "Text")]
public partial class RequiredFieldMarker : UserControl, ITextControl
{
    [Category("Settings")]
    [PersistenceMode(PersistenceMode.EncodedInnerDefaultProperty)]
    public string Text
    {
        get
        {
            return lblName.Text;
        }
        set
        {
            lblName.Text = value;
        }
    }
}

Problem

How to allow my control contains a text inside it's tags? ``` <uc:My runat="server">Text</uc:My> ``` My control contains a complex table and I want to put Text into one of cells. How to do that?

Original source

Related problems