protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { cbxLicense.Items.Clear(); XmlDocument prods = LicenseTool.LoadProducts(); foreach (XmlElement xml in prods.SelectNodes("//Product")) { ListItem item = new ListItem(); item.Text = xml.GetAttribute("text"); item.Value = xml.GetAttribute("name"); cbxLicense.Items.Add(item); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { cbxProduct.Items.Clear(); foreach (XmlElement xml in LicenseTool.LoadProducts().SelectNodes("//Product")) { string name = xml.GetAttribute("name"); if (name.EndsWith("-eval")) { ListItem li = new ListItem(); li.Text = xml.GetAttribute("text"); li.Value = name.Substring(0, name.Length - 5); cbxProduct.Items.Add(li); } } } }