Inheritance: System.Web.UI.WebControls.Literal
示例#1
0
        /// <summary>
        /// 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.
        /// </summary>
        protected override void CreateChildControls()
        {
            Controls.Clear();

            _noteEditor = new NoteEditor();
            _noteEditor.SetNoteOptions(this.NoteOptions);
            _noteEditor.ID       = this.ID + "_noteEditor";
            _noteEditor.CssClass = "note-new";

            _noteEditor.CreatedByPersonAlias = (this.Page as RockPage)?.CurrentPersonAlias;
            _noteEditor.SaveButtonClick     += note_SaveButtonClick;

            Controls.Add(_noteEditor);

            // Create a hidden field that javascript will populate with the selected note
            _hfCurrentNoteId          = new HiddenFieldWithClass();
            _hfCurrentNoteId.ID       = this.ID + "_hfCurrentNoteId";
            _hfCurrentNoteId.CssClass = "js-currentnoteid";
            Controls.Add(_hfCurrentNoteId);

            _hfExpandedNoteIds          = new HiddenFieldWithClass();
            _hfExpandedNoteIds.ID       = this.ID + "_hfExpandedNoteIds";
            _hfExpandedNoteIds.CssClass = "js-expandednoteids";
            Controls.Add(_hfExpandedNoteIds);

            // Create a hidden DeleteNote linkbutton that will hookup to the Lava'd Delete button
            _lbDeleteNote          = new LinkButton();
            _lbDeleteNote.ID       = this.ID + "_lbDeleteNote";
            _lbDeleteNote.CssClass = "js-delete-postback";
            _lbDeleteNote.Click   += _lbDeleteNote_Click;
            _lbDeleteNote.Style[HtmlTextWriterStyle.Display] = "none";
            Controls.Add(_lbDeleteNote);

            _mdDeleteWarning    = new ModalAlert();
            _mdDeleteWarning.ID = this.ID + "_mdDeleteWarning";
            Controls.Add(_mdDeleteWarning);

            _lbShowMore        = new LinkButton();
            _lbShowMore.ID     = "lbShowMore";
            _lbShowMore.Click += _lbShowMore_Click;
            _lbShowMore.AddCssClass("load-more btn btn-xs btn-action");
            Controls.Add(_lbShowMore);

            var iDownPre = new HtmlGenericControl("i");

            iDownPre.Attributes.Add("class", "fa fa-angle-down");
            _lbShowMore.Controls.Add(iDownPre);

            var spanDown = new HtmlGenericControl("span");

            spanDown.InnerHtml = " Load More ";
            _lbShowMore.Controls.Add(spanDown);

            var iDownPost = new HtmlGenericControl("i");

            iDownPost.Attributes.Add("class", "fa fa-angle-down");
            _lbShowMore.Controls.Add(iDownPost);
        }
示例#2
0
        /// <summary>
        /// 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.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            _tbNote                    = new RockTextBox();
            _hfNoteId                  = new HiddenFieldWithClass();
            _tbNote.Placeholder        = "Write a note...";
            _ddlNoteType               = new DropDownList();
            _hfHasUnselectableNoteType = new HiddenFieldWithClass();
            _cbAlert                   = new CheckBox();
            _cbPrivate                 = new CheckBox();
            _lbSaveNote                = new LinkButton();
            _aSecurity                 = new HtmlAnchor();
            _dtCreateDate              = new DateTimePicker();
            _hfParentNoteId            = new HiddenFieldWithClass();
            _mdEditWarning             = new ModalAlert();

            _hfNoteId.ID       = this.ID + "_hfNoteId";
            _hfNoteId.CssClass = "js-noteid";
            Controls.Add(_hfNoteId);

            _hfParentNoteId.ID       = this.ID + "_hfParentNoteId";
            _hfParentNoteId.CssClass = "js-parentnoteid";
            Controls.Add(_hfParentNoteId);

            _tbNote.ID                  = this.ID + "_tbNewNote";
            _tbNote.TextMode            = TextBoxMode.MultiLine;
            _tbNote.Rows                = 3;
            _tbNote.CssClass            = "js-notetext";
            _tbNote.ValidateRequestMode = ValidateRequestMode.Disabled;
            Controls.Add(_tbNote);

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

            _hfHasUnselectableNoteType.ID       = this.ID + "_hfHasUnselectableNoteType";
            _hfHasUnselectableNoteType.CssClass = "js-has-unselectable-notetype";
            Controls.Add(_hfHasUnselectableNoteType);

            _cbAlert.ID       = this.ID + "_cbAlert";
            _cbAlert.Text     = "Alert";
            _cbAlert.CssClass = "js-notealert";
            Controls.Add(_cbAlert);

            _cbPrivate.ID       = this.ID + "_cbPrivate";
            _cbPrivate.Text     = "Private";
            _cbPrivate.CssClass = "js-noteprivate";
            Controls.Add(_cbPrivate);

            _mdEditWarning.ID = this.ID + "_mdEditWarning";
            Controls.Add(_mdEditWarning);

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

            Controls.Add(_lbSaveNote);

            _aSecurity.ID = "_aSecurity";
            _aSecurity.Attributes["class"] = "btn btn-security btn-xs btn-square security js-notesecurity";
            _aSecurity.Attributes["data-entitytype-id"] = EntityTypeCache.Get(typeof(Rock.Model.Note)).Id.ToString();
            _aSecurity.InnerHtml = "<i class='fa fa-lock'></i>";
            Controls.Add(_aSecurity);

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