public void InstantiateIn(Control container) { PlaceHolder templatePlaceHolder = new PlaceHolder(); container.Controls.Add(templatePlaceHolder); templatePlaceHolder.DataBinding += new EventHandler(DataBindTemplate); Literal divContainer = new Literal(); divContainer.Text = "<div class=\"item\"><span class=\"chk-cont\">"; Obout.Interface.OboutCheckBox OboutCheckBox1 = new Obout.Interface.OboutCheckBox(); OboutCheckBox1.ID = "OboutCheckBox1"; OboutCheckBox1.ClientSideEvents.OnClick = "handleCheckBoxClick"; Literal divContainer2 = new Literal(); divContainer2.Text = "</span>"; Literal innerContainer = new Literal(); templatePlaceHolder.Controls.Add(divContainer); templatePlaceHolder.Controls.Add(OboutCheckBox1); templatePlaceHolder.Controls.Add(divContainer2); templatePlaceHolder.Controls.Add(innerContainer); }
protected void Order(object sender, EventArgs e) { StringBuilder orderedItems = new StringBuilder(); foreach (ComboBoxItem item in ComboBox1.Items) { Obout.Interface.OboutCheckBox checkbox = item.FindControl("OboutCheckBox1") as Obout.Interface.OboutCheckBox; checkbox.ClientSideEvents.OnClick = "handleCheckBoxClick"; if (checkbox.Checked) { if (orderedItems.Length > 0) { orderedItems.Append(", "); } orderedItems.Append(item.Text); } } if (orderedItems.Length > 0) { OrderDetails.Text = "<br /><br /><br /><b>The following controls have been ordered:</b> " + orderedItems.ToString() + "<br />"; } else { OrderDetails.Text = ""; } }
public void InstantiateIn(Control container) { PlaceHolder templatePlaceHolder = new PlaceHolder(); container.Controls.Add(templatePlaceHolder); templatePlaceHolder.DataBinding += new EventHandler(DataBindTemplate); Literal divContainer = new Literal(); divContainer.Text = "<div class=\"item\"><span>"; Obout.Interface.OboutCheckBox OboutCheckBox1 = new Obout.Interface.OboutCheckBox(); OboutCheckBox1.ID = "OboutCheckBox1"; OboutCheckBox1.ClientSideEvents.OnCheckedChanged = "updateComboBoxSelection"; Literal divContainer2 = new Literal(); divContainer2.Text = "</span>"; Literal innerContainer = new Literal(); templatePlaceHolder.Controls.Add(divContainer); templatePlaceHolder.Controls.Add(OboutCheckBox1); templatePlaceHolder.Controls.Add(divContainer2); templatePlaceHolder.Controls.Add(innerContainer); }