/// <summary>
        /// Raises the PreRender event.
        /// </summary>
        /// <param name="e">An EventArgs object that contains the event data. </param>
        protected override void OnPreRender(EventArgs e)
        {
            this.state.Text = this.Text;
            if (this.CommonFamilyNames != null)
            {
                this.state.CommonFamilyNames = new string[this.CommonFamilyNames.Count];
                this.CommonFamilyNames.CopyTo(this.state.CommonFamilyNames);
            }

            this.state.EndGroupDelimiter    = this.EndGroupDelimiter;
            this.state.InformationDelimiter = this.InformationDelimiter;
            if (this.InformationFormat != null)
            {
                this.state.InformationFormat = new int[this.InformationFormat.Count];
                this.state.InformationFormat = PatientSearchInputBoxExtender.ConvertInformationListToArray(this.InformationFormat);
            }

            if (this.MandatoryInformation != null)
            {
                this.state.MandatoryInformation = new int[this.MandatoryInformation.Count];
                this.state.MandatoryInformation = PatientSearchInputBoxExtender.ConvertInformationListToArray(this.MandatoryInformation);
            }

            this.state.MaximumAge          = this.MaximumAge;
            this.state.StartGroupDelimiter = this.StartGroupDelimiter;
            if (this.Titles != null)
            {
                this.state.Titles = new string[this.Titles.Count * 2];
                this.state.Titles = PatientSearchInputBoxExtender.ConvertTitleListToArray(this.Titles);
            }

            this.ClientState = new JavaScriptSerializer().Serialize(this.state);

            base.OnPreRender(e);
        }
        /// <summary>ClientStateValuesLoaded event handler</summary>
        /// <param name="sender">sender</param>
        /// <param name="e">event args</param>
        private void PatientSearchInputBoxExtender_ClientStateValuesLoaded(object sender, EventArgs e)
        {
            if (ClientState != null)
            {
                this.state = new JavaScriptSerializer().Deserialize <PatientSearchInputClientState>(ClientState);
                if (this.state.CommonFamilyNames != null)
                {
                    this.CommonFamilyNames = new List <string>(this.state.CommonFamilyNames);
                }

                this.EndGroupDelimiter    = this.state.EndGroupDelimiter;
                this.InformationDelimiter = this.state.InformationDelimiter;

                if (this.state.InformationFormat != null)
                {
                    this.InformationFormat = PatientSearchInputBoxExtender.ConvertInformationArrayToList(this.state.InformationFormat);
                }

                if (this.state.MandatoryInformation != null)
                {
                    this.MandatoryInformation = PatientSearchInputBoxExtender.ConvertInformationArrayToList(this.state.MandatoryInformation);
                }

                this.MaximumAge          = this.state.MaximumAge;
                this.StartGroupDelimiter = this.state.StartGroupDelimiter;

                if (this.state.Titles != null)
                {
                    this.Titles = PatientSearchInputBoxExtender.ConvertTitleArrayToList(this.state.Titles);
                }

                this.Text = this.state.Text;
            }
        }
Exemple #3
0
        /// <summary>
        /// CreateChildControls override
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            this.textBox    = new TextBox();
            this.textBox.ID = ID + "_TextBox";
            this.textBox.AutoCompleteType            = AutoCompleteType.Disabled;
            this.textBox.Attributes["oncontextmenu"] = "return false";
            this.textBox.Attributes["autocomplete"]  = "off";
            this.textBox.TextChanged += new EventHandler(this.TextBoxTextChanged);
            Controls.Add(this.textBox);

            // Create the extender
            this.patientSearchInputBoxExtender    = new PatientSearchInputBoxExtender();
            this.patientSearchInputBoxExtender.ID = ID + "_patientSearchInputBoxExtender";
            this.patientSearchInputBoxExtender.TargetControlID = this.textBox.ID;
            this.patientSearchInputBoxExtender.Text            = this.textBox.Text;
            this.Controls.Add(this.patientSearchInputBoxExtender);
        }