using System.Collections.Specialized; using System.ComponentModel; using System.Web.UI; using System.Web.UI.WebControls; namespace Spaanjaars.Controls { public class ModuleSettings : System.Web.UI.WebControls.WebControl { public ModuleSettings() {} private StringCollection _values = new StringCollection(); [TypeConverter(typeof(StringCollectionTypeConverter))] public StringCollection Values { get { return _values; } set { _values = value; } } protected override void Render(HtmlTextWriter writer) { base.Render(writer); } protected override void CreateChildControls() { // Test out the StringCollection and output the numbers Controls.Clear(); Literal myLiteral; foreach (string item in _values) { myLiteral = new Literal(); myLiteral.Text = string.Format("{0}
", item); this.Controls.Add(myLiteral); } } } }