I have a container of custom controls each of which have 2 controls in them. One to display when enabled (i.e. a textbox, or checkbox), and a label to display when disabled.
I've overloaded Render
like so:
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
If Me.Enabled Then
_item.RenderControl(writer)
Else
_display_text.RenderControl(writer)
End If
End Sub
however, when I set the container, which is a table, to Enabled = False
, my expected functionality doesn't happen. Instead I get grayed out textboxes and checkboxes.
What actually happens when you set a parent's Enabled
property? My assumption was that it propagated that status down to all its children, but it appears that I'm mistaken.
Thank you!