Rock.Web.UI.Controls.NoteControl.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()
        {
            base.CreateChildControls();

            _ddlNoteType.ID = this.ID + "_ddlNoteType";
            _ddlNoteType.CssClass = "form-control input-sm input-width-lg noteentry-notetype";
            _ddlNoteType.DataValueField = "Id";
            _ddlNoteType.DataTextField = "Name";
            Controls.Add( _ddlNoteType );

            _tbNote.ID = this.ID + "_tbNewNote";
            _tbNote.TextMode = TextBoxMode.MultiLine;
            _tbNote.ValidateRequestMode = ValidateRequestMode.Disabled;
            Controls.Add(_tbNote);

            _cbAlert.ID = this.ID + "_cbAlert";
            _cbAlert.Text = "Alert";
            Controls.Add(_cbAlert);

            _cbPrivate.ID = this.ID + "_cbPrivate";
            _cbPrivate.Text = "Private";
            Controls.Add(_cbPrivate);

            _lbSaveNote.ID = this.ID + "_lbSaveNote";
            _lbSaveNote.Attributes["class"] = "btn btn-primary btn-xs";
            _lbSaveNote.CausesValidation = false;
            _lbSaveNote.Click += lbSaveNote_Click;

            Controls.Add(_lbSaveNote);

            var iEdit = new HtmlGenericControl( "i" );
            iEdit.Attributes["class"] = "fa fa-pencil";
            _lbEditNote.Controls.Add( iEdit );

            _lbDeleteNote.ID = this.ID + "_lbDeleteNote";
            _lbDeleteNote.Attributes["class"] = "remove-note";
            _lbDeleteNote.CausesValidation = false;
            _lbDeleteNote.Click += lbDeleteNote_Click;
            Controls.Add( _lbDeleteNote );
            var iDelete = new HtmlGenericControl( "i" );
            iDelete.Attributes["class"] = "fa fa-times";
            _lbDeleteNote.Controls.Add( iDelete );

            _sbSecurity.ID = "_sbSecurity";
            _sbSecurity.Attributes["class"] = "btn btn-security btn-xs security pull-right";
            _sbSecurity.EntityTypeId = EntityTypeCache.Read( typeof( Rock.Model.Note ) ).Id;

            _dtCreateDate.ID = this.ID + "_tbCreateDate";
            _dtCreateDate.Label = "Note Created Date";
            Controls.Add(_dtCreateDate);

            Controls.Add( _sbSecurity );
        }