public ListSingleFormFieldAttribute(string strVar, string strLabel, bool bRequired, string values, string labels) : base(strVar, "list-single", strLabel, bRequired) { if ((values != null) && (labels != null)) { string[] saValues = values.Split(','); string[] saLabels = labels.Split(','); if (saValues.Length == saLabels.Length) { List <FormOption> listop = new List <FormOption>(); for (int i = 0; i < saValues.Length; i++) { FormOption opt = new FormOption(saLabels[i].Trim(), saValues[i].Trim()); listop.Add(opt); } Options = listop.ToArray(); } } }
public ListSingleFormFieldAttribute(string strVar, string strLabel, bool bRequired, string values, string labels) : base(strVar, "list-single", strLabel, bRequired) { if ((values != null) && (labels != null)) { string[] saValues = values.Split(','); string[] saLabels = labels.Split(','); if (saValues.Length == saLabels.Length) { List<FormOption> listop = new List<FormOption>(); for (int i = 0; i < saValues.Length; i++) { FormOption opt = new FormOption(saLabels[i].Trim(), saValues[i].Trim()); listop.Add(opt); } Options = listop.ToArray(); } } }