/// <summary> /// Raises the <see mref="Load"/> event. /// </summary> /// <param name="args">An <see cref="EventArgs"/> object that contains the event data.</param> protected override void OnLoad(EventArgs args) { base.OnLoad(args); if (!Page.IsPostBack) { StatementOfNeedHistory sonh = CPProfile.StatementOfNeedHistory; this.EnsureChildControls(); if (sonh.Primary.Documents.Count > 0) { _primary.DataSource = sonh.Primary.Documents; _primary.DataBind(); } else { _primary.Visible = false; } if (sonh.General.Documents.Count > 0) { _general.DataSource = sonh.General.Documents; _general.DataBind(); } else { _general.Visible = false; } } }
/// <summary> /// Raises the <see cref="Control.Load"/> event. /// </summary> /// <param name="e">An <see cref="EventArgs"/> object that contains the event data.</param> protected override void OnLoad(EventArgs e) { if (!Page.IsPostBack) { PreElectionDisclosureHistory pedh = CPProfile.PreElectionDisclosureHistory; this.EnsureChildControls(); if (pedh.Primary.Documents.Count > 0) { _primary.DataSource = pedh.Primary.Documents; _primary.DataBind(); } else { _primary.Visible = false; } if (pedh.General.Documents.Count > 0) { _general.DataSource = pedh.General.Documents; _general.DataBind(); } else { _general.Visible = false; } } }