How can I get my user control to properly allow for an item collection of custom classes on the ASPX side

Viewed 36

My goal is to make a user control that has a collection and within that collection a set of custom forms(which is why I use itemplate in my class).

ASPX registers the collection and I put it down but it doesn't allow me to put anything inside of it stating text is not allowed inside. What might I be doing wrong?

[Serializable]
public class ControlTest
{
    public int Id { get; set; }
    public string Name { get; set; }

    [PersistenceMode(PersistenceMode.InnerProperty)]
    public ITemplate Template { get; set; }
}

[ParseChildren(true, "ContentCollection")]
public partial class UserControls_ProgressionForm : System.Web.UI.UserControl
{
    [PersistenceMode(PersistenceMode.InnerProperty)]
    [Category("Data")]
    [Description("asdf")]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
    public List<ControlTest> ContentCollection { get; set; } = new List<ControlTest>();
}
0 Answers
Related