Esempio n. 1
0
        /// <summary>
        /// Loads the possible settings, and selects the current values.
        /// </summary>
        public override void LoadSettings()
        {
            try
            {
                base.LoadSettings();

                ((ScriptManager)AJAX.ScriptManagerControl(this.Page)).Scripts.Add(new ScriptReference("Engage.Dnn.Events.JavaScript.EngageEvents.TemplatedDisplayOptions.combined.js", Assembly.GetExecutingAssembly().FullName));

                this.LoadBoundSettings(
                    this.DateRangeFromSettings.Start,
                    this.RangeStartDropDownList,
                    this.StartSpecificDatePicker,
                    this.StartWindowAmountTextBox,
                    this.StartWindowIntervalDropDownList);

                this.LoadBoundSettings(
                    this.DateRangeFromSettings.End,
                    this.RangeEndDropDownList,
                    this.EndSpecificDatePicker,
                    this.EndWindowAmountTextBox,
                    this.EndWindowIntervalDropDownList);

                this.RecordsPerPageTextBox.Value = this.RecordsPerPage;

                this.Load += (_, __) => this.DataBind();
                this.DateRangeValidator.ServerValidate += this.DateRangeValidator_ServerValidate;
            }
            catch (Exception exc)
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
        /// <summary>
        /// Handles the <see cref="Control.Load"/> event of this control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void Page_Load(object sender, EventArgs e)
        {
            ((ScriptManager)AJAX.ScriptManagerControl(this.Page)).RegisterPostBackControl(this.ExportButton);

            if (!this.IsPostBack)
            {
                this.StartDatePicker.SelectedDate = DateTime.Today;
                this.EndDatePicker.SelectedDate   = DateTime.Today.AddDays(15);
            }

            this.StartDatePicker.Skin = this.EndDatePicker.Skin = ModuleSettings.CalendarSkin.GetValueAsStringFor(this);
        }