protected void ddlLocations_SelectedIndexChanged(object sender, EventArgs e) { clearForm(this.Controls); string name = ddlLocations.SelectedValue; if (name.Length > 0) { BHLProvider bp = new BHLProvider(); Location location = bp.LocationSelectAuto(name); if (location != null) { divAltLocations.Visible = true; nameLiteral.Text = location.LocationName; hidCode.Value = location.LocationName; latitudeTextBox.Text = location.Latitude; longitudeTextBox.Text = location.Longitude; nextAttemptLiteral.Text = location.NextAttemptDate.ToString(); includeInUICheckbox.Checked = location.IncludeInUI; ddlLocations.SelectedValue = location.LocationName; } } else { divAltLocations.Visible = false; } }