protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); // Hide the container if the Widget is null or also not visible. this.Visible = (this.Widget != null) && this.Widget.Visible; }