Rock.Web.UI.Controls.CheckinAreaRow.CreateChildControls C# (CSharp) Method

CreateChildControls() protected method

Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
protected CreateChildControls ( ) : void
return void
        protected override void CreateChildControls()
        {
            Controls.Clear();

            _hfExpanded = new HiddenFieldWithClass();
            Controls.Add( _hfExpanded );
            _hfExpanded.ID = this.ID + "_hfExpanded";
            _hfExpanded.CssClass = "area-expanded";
            _hfExpanded.Value = "False";

            _hfGroupTypeGuid = new HiddenField();
            _hfGroupTypeGuid.ID = this.ID + "_hfGroupTypeGuid";

            _lblAreaRowName = new Label();
            _lblAreaRowName.ClientIDMode = ClientIDMode.Static;
            _lblAreaRowName.ID = this.ID + "_lblAreaRowName";

            _lbAddArea = new LinkButton();
            _lbAddArea.ID = this.ID + "_lblbAddArea";
            _lbAddArea.CssClass = "btn btn-xs btn-default checkin-area-add-area";
            _lbAddArea.Click += lbAddArea_Click;
            _lbAddArea.CausesValidation = false;
            _lbAddArea.Controls.Add( new LiteralControl { Text = "<i class='fa fa-plus'></i> <i class='fa fa-folder-open'></i>" } );

            _lbAddGroup = new LinkButton();
            _lbAddGroup.ID = this.ID + "_lbAddGroup";
            _lbAddGroup.CssClass = "btn btn-xs btn-default checkin-area-add-group";
            _lbAddGroup.Click += lbAddGroup_Click;
            _lbAddGroup.CausesValidation = false;
            _lbAddGroup.Controls.Add( new LiteralControl { Text = "<i class='fa fa-plus'></i> <i class='fa fa-check-circle'></i>" } );

            _lblDeleteArea = new LinkButton();
            _lblDeleteArea.CausesValidation = false;
            _lblDeleteArea.ID = this.ID + "_lblDeleteArea";
            _lblDeleteArea.CssClass = "btn btn-xs btn-danger";
            _lblDeleteArea.Click += lblDeleteArea_Click;
            _lblDeleteArea.Controls.Add( new LiteralControl { Text = "<i class='fa fa-times'></i>" } );
            _lblDeleteArea.Attributes["onclick"] = string.Format( "javascript: return Rock.dialogs.confirmDelete(event, '{0}', '{1}');", "check-in area", "Once saved, you will lose all attendance data." );

            Controls.Add( _hfGroupTypeGuid );
            Controls.Add( _lblAreaRowName );

            Controls.Add( _lbAddArea );
            Controls.Add( _lbAddGroup );
            Controls.Add( _lblDeleteArea );
        }