Part of my Render method in a custom control contains the following code...
...where DropDownListOfStaff is a DropDownList instantiated programmatically. The rendered HTML has this SELECT element but it contains no items? Why is this? I'm new to custom controls so I assume there's something I'm missing...
Code:
DropDownListOfStaff.Items.Add(new ListItem("test", "test"));
DropDownListOfStaff.RenderControl(writer);
...where DropDownListOfStaff is a DropDownList instantiated programmatically. The rendered HTML has this SELECT element but it contains no items? Why is this? I'm new to custom controls so I assume there's something I'm missing...