private void RetrievePropertyValues(ControlCollection controls, ShouldToKnow parentWebPart) { foreach (Control ctl in controls) { RetrievePropertyValue(ctl, parentWebPart); if (ctl.HasControls()) { RetrievePropertyValues(ctl.Controls, parentWebPart); } } }
private void RetrievePropertyValue(Control ctl, ShouldToKnow parentWebPart) { if (ctl is DropDownList) { if (FieldsName.NewsCategory.FieldValuesDefault.SelectType.Equals(ctl.ID)) { DropDownList drp = (DropDownList)ctl; if (drp.SelectedItem.Value != "") { parentWebPart.NewsType = drp.SelectedItem.Text; parentWebPart.CategoryId = drp.SelectedItem.Value; } } } }
public override void ApplyChanges() { ShouldToKnow parentWebPart = (ShouldToKnow)this.ParentToolPane.SelectedWebPart; RetrievePropertyValues(this.Controls, parentWebPart); }