Literal content is not allowed within a UserControl

前端 未结 4 1538
有刺的猬
有刺的猬 2021-01-18 02:38

How to allow my control contains a text inside it\'s tags?

Text

My control contains a complex t

4条回答
  •  日久生厌
    2021-01-18 03:27

    [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;
            }
        }
    }
    

提交回复
热议问题