public void doStuff() { var props = new[]{ "txtFacility", "txtCity", "txtZip", "rblFacilityType", "cboSubs", "ddlbCounty", "ddlStar", "cblProgramOp", "cblAgeCat", "cblTrans"}; foreach (var v in props) { if (FindControl(v) != null) { switch (v.Substring(0, 3)) { case "cbl": critString += fillcbxl((CheckBoxList)FindControl(v)); break; case "ddl": critString += fillddl((DropDownList)FindControl(v)); break; case "cbo": critString += fillcbx((CheckBox)FindControl(v)); break; case "rbl": critString += fillrbl((RadioButtonList)FindControl(v)); break; default: critString += fillTextBox((TextBox)FindControl(v)); break; } } } }
// Declare a new StringBuilder. StringBuilder builder = new StringBuilder(); builder.Append(fillcbxl((CheckBoxList)FindControl(v)));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)