상속: RockDropDownList
예제 #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();

            _componentPicker = new ComponentPicker()
            {
                ContainerType = "Rock.Security.BackgroundCheckContainer"
            };
            _componentPicker.ID                    = this.ID + "_componentPicker";
            _componentPicker.AutoPostBack          = true;
            _componentPicker.SelectedIndexChanged += _componentPicker_SelectedIndexChanged;
            Controls.Add(_componentPicker);

            _fileUploader         = new FileUploader();
            _fileUploader.ID      = this.ID + "_fileUploader";
            _fileUploader.Visible = false;
            Controls.Add(_fileUploader);

            _textBox         = new RockTextBox();
            _textBox.ID      = this.ID + "_rockTextBox";
            _textBox.Label   = "RecordKey";
            _textBox.Help    = "Unique key for the background check report.";
            _textBox.Visible = false;
            Controls.Add(_textBox);
        }
예제 #2
0
        /// <summary>
        /// Creates the control(s) neccessary for prompting user for a new value
        /// </summary>
        /// <param name="configurationValues">The configuration values.</param>
        /// <param name="id"></param>
        /// <returns>
        /// The control
        /// </returns>
        public override Control EditControl( Dictionary<string, ConfigurationValue> configurationValues, string id )
        {
            try
            {
                ComponentPicker editControl = new ComponentPicker { ID = id }; 

                if ( configurationValues != null && configurationValues.ContainsKey( "container" ) )
                {
                    editControl.ContainerType = configurationValues["container"].Value;
                }

                return editControl;
            }
            catch ( SystemException ex )
            {
                return new LiteralControl( ex.Message );
            }
        }