Rock.Web.UI.Controls.RockRadioButtonList.OnLoad C# (CSharp) Method

OnLoad() protected method

Handles the E:System.Web.UI.Control.Load event.
protected OnLoad ( System e ) : void
e System An object that contains event data.
return void
        protected override void OnLoad( System.EventArgs e )
        {
            base.OnLoad( e );

            // If a radiobutton list has no items selected, then there is not anything included in
            // the control state for this control, so on postback a value is not set, and the
            // creation of child controls will not be called.  this presents a problem when using
            // validation since it is during the CreateChildControls that the validator is rewired
            // to the control.  Because of this, always ensure child controls on a postback
            if (Page.IsPostBack)
            {
                EnsureChildControls();
            }
        }