Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Literal content is not allowed within a UserControl

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?

like image 405
abatishchev Avatar asked Dec 01 '09 17:12

abatishchev


1 Answers

[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;
        }
    }
}
like image 99
abatishchev Avatar answered Oct 19 '22 14:10

abatishchev