/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _date = new TextBox(); _date.ID = "tbDate"; _date.AddCssClass("form-control js-datetime-date"); Controls.Add(_date); _time = new TextBox(); _time.ID = "tbTime"; _time.AddCssClass("form-control js-datetime-time"); Controls.Add(_time); _cbCurrent = new RockCheckBox(); _cbCurrent.ID = "cbCurrent"; _cbCurrent.AddCssClass("js-current-datetime-checkbox"); _cbCurrent.Text = "Current Time"; this.Controls.Add(_cbCurrent); _nbTimeOffset = new RockTextBox(); _nbTimeOffset.ID = "nbTimeOffset"; _nbTimeOffset.Help = "Enter the number of minutes after the current time to use as the date. Use a negative number to specify minutes before."; _nbTimeOffset.AddCssClass("input-width-md js-current-datetime-offset"); _nbTimeOffset.Label = "+- Minutes"; this.Controls.Add(_nbTimeOffset); RequiredFieldValidator.ControlToValidate = _date.ID; }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _divControl = new HtmlGenericControl("div"); _divControl.Attributes["class"] = "btn-group " + this.FormGroupCssClass; _divControl.ClientIDMode = ClientIDMode.Static; _divControl.ID = string.Format("ButtonDropDown_{0}", this.ID); _hfSelectedItemId = new HiddenField(); _hfSelectedItemId.ClientIDMode = ClientIDMode.Static; _hfSelectedItemId.ID = string.Format("hfSelectedItemId_{0}", this.ID); _btnSelect = new HtmlGenericControl("button"); _divControl.Controls.Add(_btnSelect); _btnSelect.ClientIDMode = ClientIDMode.Static; _btnSelect.ID = string.Format("ButtonDropDown_btn_{0}", this.ID); _btnSelect.Attributes["type"] = "button"; _btnSelect.Attributes["class"] = "btn btn-default dropdown-toggle " + this.CssClass; _btnSelect.Attributes["data-toggle"] = "dropdown"; _listControl = new HtmlGenericControl("ul"); _divControl.Controls.Add(_listControl); _listControl.Attributes["class"] = "dropdown-menu"; Controls.Add(_divControl); Controls.Add(_hfSelectedItemId); RequiredFieldValidator.InitialValue = string.Empty; RequiredFieldValidator.ControlToValidate = _hfSelectedItemId.ID; }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _childControlWrapper = new HtmlGenericControl("div"); _hfSelectedItemId = new HiddenFieldWithClass(); _hfSelectedItemId.CssClass = "js-buttondropdown-selected-id"; _hfSelectedItemId.ID = "_hfSelectedItemId"; _btnSelect = new HtmlGenericControl("button"); _childControlWrapper.Controls.Add(_btnSelect); _btnSelect.ID = "_btnSelect"; _btnSelect.Attributes["type"] = "button"; _btnSelect.Attributes["class"] = "btn btn-default dropdown-toggle js-buttondropdown-btn-select " + this.CssClass; _btnSelect.Attributes["data-toggle"] = "dropdown"; _listControl = new HtmlGenericControl("ul"); _childControlWrapper.Controls.Add(_listControl); _listControl.Attributes["class"] = "dropdown-menu"; _childControlWrapper.Controls.Add(_hfSelectedItemId); Controls.Add(_childControlWrapper); RequiredFieldValidator.InitialValue = string.Empty; RequiredFieldValidator.ControlToValidate = _hfSelectedItemId.ID; }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _tbLowerValue = new DatePicker(); _tbLowerValue.EnableJavascript = false; _tbLowerValue.ID = this.ID + "_lower"; _tbLowerValue.CssClass = "input-group-lower js-lower"; Controls.Add(_tbLowerValue); _tbUpperValue = new DatePicker(); _tbUpperValue.EnableJavascript = false; _tbUpperValue.ID = this.ID + "_upper"; _tbUpperValue.CssClass = "input-group-upper js-upper"; Controls.Add(_tbUpperValue); // add custom validator CustomValidator.ID = this.ID + "_cfv"; CustomValidator.ClientValidationFunction = "Rock.controls.dateRangePicker.clientValidate"; CustomValidator.ErrorMessage = (this.Label != string.Empty ? this.Label : string.Empty) + " is required."; CustomValidator.CssClass = "validation-error help-inline"; CustomValidator.Enabled = true; CustomValidator.Display = ValidatorDisplay.Dynamic; CustomValidator.ValidationGroup = ValidationGroup; Controls.Add(CustomValidator); }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _hfBinaryFileId.ID = this.ID + "_hfBinaryFileId"; _hfBinaryFileId.Value = "0"; Controls.Add(_hfBinaryFileId); _hfBinaryFileTypeGuid.ID = this.ID + "_hfBinaryFileTypeGuid"; Controls.Add(_hfBinaryFileTypeGuid); _hfContentFileSource.ID = this.ID + "_hfContentFileSource"; Controls.Add(_hfContentFileSource); _aRemove = new HtmlAnchor(); _aRemove.ID = "rmv"; _aRemove.InnerHtml = "<i class='fa fa-times'></i>"; Controls.Add(_aRemove); _fileUpload = new FileUpload(); _fileUpload.ID = this.ID + "_fu"; Controls.Add(_fileUpload); RequiredFieldValidator.InitialValue = "0"; RequiredFieldValidator.ControlToValidate = _hfBinaryFileId.ID; RequiredFieldValidator.Display = ValidatorDisplay.Dynamic; }
/// <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(); Controls.Clear(); _ddlGroupType = new RockDropDownList(); _ddlGroup = new RockDropDownList(); _ddlGroupRole = new RockDropDownList(); RockControlHelper.CreateChildControls(this, Controls); _ddlGroupType.ID = this.ID + "_ddlGroupType"; _ddlGroupType.AutoPostBack = true; _ddlGroupType.SelectedIndexChanged += _ddlGroupType_SelectedIndexChanged; _ddlGroupType.Label = "Group Type"; Controls.Add(_ddlGroupType); _ddlGroup.ID = this.ID + "_ddlGroup"; Controls.Add(_ddlGroup); this.RequiredFieldValidator.ControlToValidate = _ddlGroup.ID; _ddlGroupRole.ID = this.ID + "_ddlGroupRole"; Controls.Add(_ddlGroupRole); LoadGroupTypes(); }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); monthDropDownList = new DropDownList(); monthDropDownList.CssClass = "form-control input-width-sm"; monthDropDownList.ID = "monthDropDownList_" + this.ID; monthDropDownList.SelectedIndexChanged += dateList_SelectedIndexChanged; dayDropDownList = new DropDownList(); dayDropDownList.CssClass = "form-control input-width-sm"; dayDropDownList.ID = "dayDropDownList_" + this.ID; dayDropDownList.SelectedIndexChanged += dateList_SelectedIndexChanged; yearDropDownList = new DropDownList(); yearDropDownList.CssClass = "form-control input-width-sm"; yearDropDownList.ID = "yearDropDownList_" + this.ID; yearDropDownList.SelectedIndexChanged += dateList_SelectedIndexChanged; Controls.Add(monthDropDownList); Controls.Add(dayDropDownList); Controls.Add(yearDropDownList); PopulateDropDowns(); }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _hfDisableVrm = new HiddenField(); _hfDisableVrm.ID = this.ID + "_dvrm"; _hfDisableVrm.Value = "True"; Controls.Add(_hfDisableVrm); _hfInCodeEditorMode = new HiddenFieldWithClass(); _hfInCodeEditorMode.CssClass = "js-incodeeditormode"; _hfInCodeEditorMode.ID = this.ID + "_hfInCodeEditorMode"; Controls.Add(_hfInCodeEditorMode); _ceEditor = new CodeEditor(); _ceEditor.ID = this.ID + "_codeEditor"; _ceEditor.CssClass = "html-editor-code-editor"; _ceEditor.EditorMode = CodeEditorMode.Lava; _ceEditor.EditorHeight = this.Height.Value.ToString(); if (!string.IsNullOrEmpty(this.CallbackOnChangeScript)) { _ceEditor.OnChangeScript = this.CallbackOnChangeScript; } Controls.Add(_ceEditor); }
/// <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(); Controls.Clear(); _ddlGroupType = new RockDropDownList() { ID = $"{this.ID}_ddlGroupType", AutoPostBack = true, Label = "Group Type", ViewStateMode = this.ViewStateMode }; _ddlGroupType.SelectedIndexChanged += _ddlGroupType_SelectedIndexChanged; Controls.Add(_ddlGroupType); _ddlGroup = new RockDropDownList() { ID = $"{this.ID}_ddlGroup", ViewStateMode = this.ViewStateMode }; Controls.Add(_ddlGroup); _ddlGroupRole = new RockDropDownList() { ID = $"{this.ID}_ddlGroupRole", ViewStateMode = this.ViewStateMode }; Controls.Add(_ddlGroupRole); RockControlHelper.CreateChildControls(this, Controls); this.RequiredFieldValidator.ControlToValidate = _ddlGroup.ID; LoadGroupTypes(); }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); Controls.Add(_hfBinaryFileId); _hfBinaryFileId.ID = this.ID + "_hfBinaryFileId"; _hfBinaryFileId.Value = "0"; Controls.Add(_hfBinaryFileTypeGuid); _hfBinaryFileTypeGuid.ID = this.ID + "_hfBinaryFileTypeGuid"; _aFileName = new HtmlAnchor(); Controls.Add(_aFileName); _aFileName.ID = "fn"; _aFileName.Target = "_blank"; _aFileName.AddCssClass("file-link"); _aRemove = new HtmlAnchor(); Controls.Add(_aRemove); _aRemove.ID = "rmv"; _aRemove.HRef = "#"; _aRemove.InnerHtml = "<i class='fa fa-times'></i>"; _aRemove.Attributes["class"] = "remove-file"; _fileUpload = new FileUpload(); Controls.Add(_fileUpload); _fileUpload.ID = this.ID + "_fu"; RequiredFieldValidator.InitialValue = "0"; RequiredFieldValidator.ControlToValidate = _hfBinaryFileId.ID; RequiredFieldValidator.Display = ValidatorDisplay.Dynamic; }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _hfMin = new HiddenFieldWithClass(); _hfMin.ID = string.Format("{0}_hfMin", this.ID); _hfMin.CssClass = "js-number-up-down-min"; _hfMin.Value = int.MinValue.ToString(); Controls.Add(_hfMin); _hfMax = new HiddenFieldWithClass(); _hfMax.ID = string.Format("{0}_hfMax", this.ID); _hfMax.CssClass = "js-number-up-down-max"; _hfMax.Value = int.MaxValue.ToString(); Controls.Add(_hfMax); _hfNumber = new HiddenFieldWithClass(); _hfNumber.ID = string.Format("{0}_hfNumber", this.ID); _hfNumber.CssClass = "js-number-up-down-value"; _hfNumber.Value = "0"; Controls.Add(_hfNumber); _lblNumber = new Label(); _lblNumber.ID = string.Format("{0}_lblNumber", this.ID); Controls.Add(_lblNumber); RequiredFieldValidator.InitialValue = string.Empty; RequiredFieldValidator.ControlToValidate = _hfNumber.ID; }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { bool renderLabel = (!string.IsNullOrEmpty(Label)); bool renderHelp = (HelpBlock != null && !string.IsNullOrWhiteSpace(Help)); bool renderWarning = (WarningBlock != null && !string.IsNullOrWhiteSpace(Warning)); // If rendering help text with no label, the CheckBoxAdapter will need to render the help, so it needs to be temporarily // blanked out so that the RockControlHelper does not render it TemporaryHelpValue = Help; if (!renderLabel && renderHelp) { Help = string.Empty; } // If rendering warning text with no label, the CheckBoxAdapter will need to render the warning, so it needs to be temporarily // blanked out so that the RockControlHelper does not render it TemporaryWarningValue = Warning; if (!renderLabel && renderWarning) { Warning = string.Empty; } RockControlHelper.RenderControl(this, writer); } }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { RockControlHelper.RenderControl(this, writer); } }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "margin-b-md"); RockControlHelper.RenderControl(this, writer); } }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { string required = Required ? " required" : string.Empty; writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group margin-b-md js-number-up-down-group " + required); RockControlHelper.RenderControl(this, writer); } }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); this.SelectionMode = ListSelectionMode.Multiple; }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { RegisterJavaScript(); if (this.Visible) { RockControlHelper.RenderControl(this, writer); } }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { // Set the required field message here because the control label may have been modified during initialization. this.RequiredFieldValidator.ErrorMessage = string.Format("{0} must have at least one value.", this.Label); RockControlHelper.RenderControl(this, writer); } }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _hfCountryCode = new HiddenField(); _hfCountryCode.ID = this.ID + "_hfCountryCode"; Controls.Add(_hfCountryCode); }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _bulletedList = new BulletedList(); _bulletedList.ID = this.ID; Controls.Add(_bulletedList); }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _mfpMergeFields = new MergeFieldPicker(); _mfpMergeFields.ID = string.Format("mfpMergeFields_{0}", this.ID); _mfpMergeFields.SelectItem += MergeFields_SelectItem; Controls.Add(_mfpMergeFields); }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _hfDisableVrm = new HiddenField(); _hfDisableVrm.ID = this.ID + "_dvrm"; _hfDisableVrm.Value = "True"; Controls.Add(_hfDisableVrm); }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { writer.AddAttribute("class", "js-slidingdaterange-container " + this.CssClass); writer.RenderBeginTag("div"); RockControlHelper.RenderControl(this, writer, "slidingdaterange"); writer.RenderEndTag(); } }
/// <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(); Controls.Clear(); _hfTemplateKey = new HiddenFieldWithClass(); _hfTemplateKey.ID = this.ID + "_hfValue"; _hfTemplateKey.CssClass = "js-template-id"; this.Controls.Add(_hfTemplateKey); _pnlStandard = new Panel(); _pnlStandard.ID = this.ID + "_pnlOption"; _pnlStandard.CssClass = "js-template-option-panel"; this.Controls.Add(_pnlStandard); _btnCustomize = new LinkButton(); _btnCustomize.CssClass = "btn btn-xs btn-link"; _btnCustomize.ID = string.Format("{0}_btnCustomize", this.ID); _btnCustomize.Text = "Customize"; _btnCustomize.CausesValidation = false; _btnCustomize.Click += btnCustomize_Click; this.Controls.Add(_btnCustomize); _pnlCustom = new Panel(); _pnlCustom.ID = this.ID + "pnlCustom"; _pnlCustom.CssClass = "js-template-custom-panel"; this.Controls.Add(_pnlCustom); _rbbCustom = new RockRadioButton(); _rbbCustom.Checked = true; _rbbCustom.Text = "<b>Custom</b>"; _pnlCustom.Controls.Add(_rbbCustom); _actionDiv = new HtmlGenericControl("div"); _pnlCustom.Controls.Add(_actionDiv); _actionDiv.Attributes["class"] = "actions clearfix"; _btnStandard = new LinkButton(); _btnStandard.CssClass = "btn btn-xs btn-link pull-right"; _btnStandard.ID = string.Format("{0}_btnStandard", this.ID); _btnStandard.Text = "Use Standard Templates"; _btnStandard.CausesValidation = false; _btnStandard.Click += btnStandard_Click; _actionDiv.Controls.Add(_btnStandard); _ceLavaTemplate = new CodeEditor(); _ceLavaTemplate.ID = this.ID + "_ceLavaTemplate"; _ceLavaTemplate.CssClass = "js-template-lava-field"; _pnlCustom.Controls.Add(_ceLavaTemplate); RockControlHelper.CreateChildControls(this, Controls); }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); // TBD TODO -- do I need this hfGeoDisplayName_??? _hfGeoDisplayName = new HiddenField(); _hfGeoDisplayName.ClientIDMode = System.Web.UI.ClientIDMode.Static; _hfGeoDisplayName.ID = string.Format("hfGeoDisplayName_{0}", this.ClientID); _hfGeoPath = new HiddenField(); _hfGeoPath.ClientIDMode = System.Web.UI.ClientIDMode.Static; _hfGeoPath.ID = string.Format("hfGeoPath_{0}", this.ClientID); if (ModePanel != null) { this.Controls.Add(ModePanel); } _btnSelect.ClientIDMode = System.Web.UI.ClientIDMode.Static; _btnSelect.Attributes["class"] = "btn btn-xs btn-primary"; _btnSelect.ID = string.Format("btnSelect_{0}", this.ClientID); _btnSelect.InnerText = "Done"; _btnSelect.CausesValidation = false; // we only need the postback on Select if SelectItem is assigned if (SelectGeography != null) { _btnSelect.ServerClick += btnSelect_Click; } _btnSelectNone.ClientIDMode = ClientIDMode.Static; _btnSelectNone.Attributes["class"] = "picker-select-none"; _btnSelectNone.ID = string.Format("btnSelectNone_{0}", this.ClientID); _btnSelectNone.InnerHtml = "<i class='fa fa-times'></i>"; _btnSelectNone.CausesValidation = false; _btnSelectNone.Style[HtmlTextWriterStyle.Display] = "none"; // we only need the postback on SelectNone if SelectItem is assigned if (SelectGeography != null) { _btnSelectNone.ServerClick += btnSelect_Click; } Controls.Add(_hfGeoDisplayName); Controls.Add(_hfGeoPath); Controls.Add(_btnSelect); Controls.Add(_btnSelectNone); RequiredFieldValidator.InitialValue = "0"; RequiredFieldValidator.ControlToValidate = _hfGeoPath.ID; }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); _hfValue = new HiddenField(); _hfValue.ID = this.ID + "_hfValue"; Controls.Add(_hfValue); this.RequiredFieldValidator.InitialValue = "{}"; this.RequiredFieldValidator.ControlToValidate = _hfValue.ID; }
/// <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. /// This method will also create the DefinedValueEditor /// </summary> protected override void CreateChildControls() { base.CreateChildControls(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); DefinedValueEditorControl = new DefinedValueEditor(); DefinedValueEditorControl.ID = this.ID + "_definedValueEditor"; DefinedValueEditorControl.Hidden = true; DefinedValueEditorControl.DefinedTypeId = DefinedTypeId.Value; DefinedValueEditorControl.DefinedValueSelectorClientId = this.ClientID; Controls.Add(DefinedValueEditorControl); }
/// <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(); Controls.Clear(); _hfCheckListBoxId = new HiddenField(); _hfCheckListBoxId.ID = "hf"; _hfCheckListBoxId.Value = "1"; Controls.Add(_hfCheckListBoxId); RockControlHelper.CreateChildControls(this, Controls); }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { if (this.MaxLength != 0 && this.ShowCountDown) { writer.AddAttribute("class", "pull-right badge"); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID + "_em"); writer.RenderBeginTag(HtmlTextWriterTag.Em); writer.RenderEndTag(); } RockControlHelper.RenderControl(this, writer); } }
/// <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(); Controls.Clear(); RockControlHelper.CreateChildControls(this, Controls); hfSSN = new HiddenFieldWithClass(); hfSSN.ID = string.Format("hfSSN_{0}", this.ID); hfSSN.CssClass = "js-ssn"; this.RegularExpressionValidator.ID = ID + "_rev"; this.RegularExpressionValidator.CssClass = "validation-error help-inline"; this.RegularExpressionValidator.ValidationExpression = @"\d{3}-\d{2}-\d{4}"; this.RegularExpressionValidator.ControlToValidate = hfSSN.ID; this.RegularExpressionValidator.ErrorMessage = (this.Label != string.Empty ? this.Label : "SSN") + " is invalid."; this.RegularExpressionValidator.Enabled = true; this.RegularExpressionValidator.Display = ValidatorDisplay.Dynamic; this.RegularExpressionValidator.ValidationGroup = ValidationGroup; Controls.Add(this.RegularExpressionValidator); this.RequiredFieldValidator.InitialValue = string.Empty; this.RequiredFieldValidator.ControlToValidate = hfSSN.ID; ssnArea = new TextBox(); ssnArea.CssClass = "form-control ssn-part ssn-area"; ssnArea.ID = "ssnArea_" + this.ID; ssnArea.TextMode = TextBoxMode.Password; ssnArea.Attributes["pattern"] = "[0-9]*"; ssnArea.MaxLength = 3; ssnGroup = new TextBox(); ssnGroup.CssClass = "form-control ssn-part ssn-group"; ssnGroup.ID = "ssnGroup_" + this.ID; ssnGroup.TextMode = TextBoxMode.Password; ssnGroup.Attributes["pattern"] = "[0-9]*"; ssnGroup.MaxLength = 2; ssnSerial = new TextBox(); ssnSerial.CssClass = "form-control ssn-part ssn-serial"; ssnSerial.ID = "ssnSerial_" + this.ID; ssnGroup.Attributes["pattern"] = "[0-9]*"; ssnSerial.MaxLength = 4; Controls.Add(hfSSN); Controls.Add(ssnArea); Controls.Add(ssnGroup); Controls.Add(ssnSerial); }