Allowing a Server Control to Contain Custom Child Collection

I’ve probably done this at least a dozen times, but when you don’t do something everyday, you tend to forget. I created a custom control that I wanted to place into a control collection. So, I created the child control as a custom server control. Then I created another server control that contained a property called Items as a Generic.List(Of T) where T was my custom child control. I kept running my app and couldn’t figure out why I couldn’t create my child controls in the Parent. I forgot that I had to import the namespace System.ComponentModel and add the PersistenceMode property to the property. So, my code looked like this:

Visual Basic

Public Class MyServerControlCollection
Inherits WebControl

Private _Items As Generic.List(Of MyChildControl)

    <PersistenceMode(PersistenceMode.InnerProperty)> _
    Public Property Items() As Generic.List(Of MyChildControl)
End Get
(ByVal value As Generic.List(Of MyChildControl))
End Set
    End Property

    Protected Overrides Sub 
For Each obj As MyChildControl In Items

End Sub

End Class


public class MyServerControlCollection : WebControl

private Generic.List<MyChildControl> _Items;

Generic.List<MyChildControl> Items {
get return _Items}
set { _Items = value; }

protected override void CreateChildControls()
foreach (MyChildControl obj in Items) {



Hope that helps!

Internet Explorer 8 Beta 1 – Websites that are Broken

IE8 Beta 1 now forces CSS 2.1 along with other web standards (includes some early HTML 5 stuff too!). I’m creating a list of websites that seem to be broken by the browser. Feel free to leave a comment if you come across other sites. Here’s what I found so far (notice that only part of the site may be broken and not necessarily all of the site):

  • (missing menu bar at the top and bottom)
  • (textbox at the bottom on the page)
  • (content layout)
  • (search bar)
  • (content layout)
  • (where’s the content?)
  • (missing some menu in the left column)
  • (some elements are not aligned properly)
  • (items not aligned properly)
  • (main page)