protected override void Render(HtmlTextWriter output) { PlaceHolder plh = new PlaceHolder(); Table table = new Table(); table.Rows.Add(new TableRow()); table.Rows[0].Cells.Add(new TableCell()); table.Rows[0].Cells.Add(new TableCell()); HtmlGenericControl txt = new HtmlGenericControl("input"); txt.EnableViewState = false; txt.Attributes.CssStyle.Add(HtmlTextWriterStyle.Color, Color); txt.Attributes.Add("maxlength", "15"); txt.Attributes.Add("size", "15"); txt.Attributes.Add("value", Color); txt.Attributes.Add("id", ColorInputControlClientId); txt.Attributes.Add("name", this.UniqueID); table.Rows[0].Cells[0].Controls.Add(txt); HtmlInputImage btn = new HtmlInputImage(); btn.Src = Page.ClientScript.GetWebResourceUrl(typeof(ColorPicker), "Lib.Images.ColorPickerIcon.jpg"); btn.Attributes.Add("onclick", string.Format("colorPicker.ShowColorPicker(this,document.getElementById('{0}'));return false;", ColorInputControlClientId)); HtmlGenericControl container = new HtmlGenericControl("div"); container.EnableViewState = false; container.Controls.Add(btn); container.Attributes.CssStyle.Add(HtmlTextWriterStyle.Position, "relative"); container.Attributes.CssStyle.Add(HtmlTextWriterStyle.Display, "block"); table.Rows[0].Cells[1].Controls.Add(container); plh.Controls.Add(table); plh.RenderControl(output); }
protected void imgbtnMove_ServerClick(object sender, ImageClickEventArgs e) { HtmlInputImage imgbtnMove = sender as HtmlInputImage; ViewState["Move_FileId"] = this.gvFile.DataKeys[Convert.ToInt32(imgbtnMove.Value) - 1].Value.ToString(); MyOffice.Models.FileInfo file = FileInfoManager.GetFileByFileId(Convert.ToInt32(this.gvFile.DataKeys[Convert.ToInt32(imgbtnMove.Value) - 1].Value)); this.txtMoveFileName.Text = file.FileName; }
protected override void RenderContents(HtmlTextWriter output) { TextBox tb = (TextBox)FindControl(TargetControlID); Table table = new Table(); table.Rows.Add(new TableRow()); table.Rows[0].Cells.Add(new TableCell()); table.Rows[0].Cells.Add(new TableCell()); //HtmlInputText txt = new HtmlInputText(); HtmlInputImage btnHidden = new HtmlInputImage(); HtmlInputImage btnShow = new HtmlInputImage(); //txt.ID = "txt" + ColorInputControlClientId; btnShow.ID = "btnShow" + ColorInputControlClientId; btnHidden.ID = "btnHidden" + ColorInputControlClientId; //txt.Attributes.CssStyle.Add(HtmlTextWriterStyle.Color, Color); //txt.Size = 4; //txt.Value = Color; //txt.MaxLength = 15; //txt.Name = ColorInputControlClientName; //txt.Attributes.Add("class","input1"); //table.Rows[0].Cells[0].Controls.Add(txt); //modify by wsl btnHidden.Src = Page.ClientScript.GetWebResourceUrl(typeof(ColorPicker), ReadOnly ? "ColorPickerControl.Images.ColorPickerIcon_ReadOnly.gif" : "ColorPickerControl.Images.ColorPickerIcon.gif"); btnHidden.Attributes.CssStyle.Add(HtmlTextWriterStyle.Display, "none"); table.Rows[0].Cells[0].Controls.Add(btnHidden); table.Rows[0].Cells[0].Attributes.CssStyle.Add(HtmlTextWriterStyle.Position, "relative"); //add by wsl btnShow.Src = Page.ClientScript.GetWebResourceUrl(typeof(ColorPicker), ReadOnly ? "ColorPickerControl.Images.ColorPickerIcon_ReadOnly.gif" : "ColorPickerControl.Images.ColorPickerIcon.gif"); if (!ReadOnly) { btnShow.Attributes.Add("onclick", string.Format( "colorPicker.ShowColorPicker('{0}','{1}','{2}');return false;", btnHidden.ClientID, btnShow.ClientID, tb.ClientID)); } else { btnShow.Attributes.Add("onclick", "return false;"); } btnShow.Attributes.CssStyle.Add(HtmlTextWriterStyle.BackgroundColor, tb.Text.Trim()); table.Rows[0].Cells[1].Controls.Add(btnShow); //Ö»¶Á table.RenderControl(output); count++; }
/// <summary> /// Sets the causes validation property to false, if such a property exists in the m_cToTest. /// This is needed because for controls that cause validation, the ValidationControls on the page /// generate a client side script. /// That feature is not working properly in GrassHopper, and is not the main issue of this test. /// It will be testes specificly in the Validation control tests. /// </summary> private void HandleCausesValidation() { //HtmlButton: HtmlButton hButton = m_cToTest as HtmlButton; if (hButton != null) { hButton.CausesValidation = false; } //HtmlInputButton HtmlInputButton hInputButton = m_cToTest as HtmlInputButton; if (hInputButton != null) { hInputButton.CausesValidation = false; } //HtmlInputImage HtmlInputImage hInputImage = m_cToTest as HtmlInputImage; if (hInputImage != null) { hInputImage.CausesValidation = false; } //Button: Button button = m_cToTest as Button; if (button != null) { button.CausesValidation = false; } //ImageButton ImageButton imageButton = m_cToTest as ImageButton; if (imageButton != null) { imageButton.CausesValidation = false; } //LinkButton LinkButton linkButton = m_cToTest as LinkButton; if (linkButton != null) { linkButton.CausesValidation = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { using (Mybooks mb = new Mybooks()) { List <Book> booklist = mb.Books.ToList(); foreach (Book bookdetail in booklist) { HtmlGenericControl newDiv = new HtmlGenericControl("DIV"); HtmlGenericControl details = new HtmlGenericControl("DIV"); HtmlInputImage image = new HtmlInputImage(); HtmlAnchor anch = new HtmlAnchor(); image.Src = "images/" + bookdetail.ISBN + ".jpg"; image.Disabled = true; image.Style.Add("width", "200px"); image.Style.Add("height", "220px"); anch.InnerHtml = "<hr><strong style=\"font-size: 16px;\">" + bookdetail.Title + "</strong><br />"; details.InnerHtml += bookdetail.Author + "<br />"; details.InnerHtml += bookdetail.ISBN + "<br />"; details.InnerHtml += "$ " + bookdetail.Price; newDiv.Attributes.Add("class", "col-xs-12 col-sm-6 col-md-4 well"); newDiv.Style.Add("height", "500px"); newDiv.Style.Add("text-align", "center"); newDiv.Style.Add("padding", "30px"); anch.HRef = "~/BookDetails1.aspx?id=" + bookdetail.BookID; mainDiv.Controls.Add(newDiv); newDiv.Controls.Add(image); newDiv.Controls.Add(anch); newDiv.Controls.Add(details); } } } else { } }
/// <summary> /// 控件处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dv = e.Item.DataItem as DataRowView; Int32 ID = Convert.ToInt32(dv["id"]); ImageButton del = e.Item.FindControl("del") as ImageButton; ImageButton audit = e.Item.FindControl("audit") as ImageButton; HtmlInputImage detail = e.Item.FindControl("detail") as HtmlInputImage; detail.Attributes.Add("onclick", String.Format("javascript:dialogIFrame({{url:'Comment_Edit.aspx?id={0}',title:'详细 - {1}',width:500, height: 400}});return false;", ID, dv["title"])); if (Convert.ToBoolean(dv["audit"])) { audit.ImageUrl = "images/icos/checkbox_yes.png"; } del.OnClientClick = String.Format("javascript:dialogConfirm({{el:this,text:'将删除 {0} 且无法恢复!确定要删除吗?'}});return false;", dv["Title"]); } }
protected override void Render(HtmlTextWriter output) { PlaceHolder target = new PlaceHolder(); if (base.DesignMode || (this.Page.Header == null)) { this.RegisterCSSInclude(target); } Table child = new Table(); child.Rows.Add(new TableRow()); child.Rows[0].Cells.Add(new TableCell()); child.Rows[0].Cells.Add(new TableCell()); TextBox control = new TextBox(); control.Width = this.Width; control.Height = this.Height; control.CssClass = this.CssClass; control.MaxLength = 15; control.ForeColor = System.Drawing.ColorTranslator.FromHtml(this.Color); control.Text = this.Color; control.ID = this.ClientID; child.Rows[0].Cells[0].Controls.Add(control); HtmlInputImage image = new HtmlInputImage(); image.Src = GetWebResourceUrl("ColorPickerIcon.jpg"); image.Attributes.Add("onclick", string.Format("colorPicker.ShowColorPicker(this,document.getElementById('{0}'));return false;", this.ClientID)); HtmlGenericControl control2 = new HtmlGenericControl("div"); control2.EnableViewState = false; control2.Controls.Add(image); control2.Attributes.CssStyle.Add(HtmlTextWriterStyle.Position, "relative"); control2.Attributes.CssStyle.Add(HtmlTextWriterStyle.Display, "block"); child.Rows[0].Cells[1].Controls.Add(control2); target.Controls.Add(child); target.RenderControl(output); }
protected override void CreateChildControls() { txtPickDate = new TextBox(); txtPickDate.ID = "txtPickDate"; btnPickDate = new HtmlButton(); btnPickDate.ID = "btnPickDate"; btnImage = new HtmlInputImage(); btnImage.ID = "btnImage"; if (this.Site != null && this.Site.DesignMode) { } else { this.Controls.Add(this.txtPickDate); Literal spacer = new Literal(); //spacer.Text = " "; this.Controls.Add(spacer); this.Controls.Add(btnImage); this.Controls.Add(btnPickDate); } }
// Настраиваем контролы для отображения поля на форме редактирования private void SetupEditTemplateControls() { FileUpload fuDocument = (FileUpload)TemplateContainer.FindControl("fuDocument"); HyperLink aFile = (HyperLink)TemplateContainer.FindControl("aFile"); HiddenField hdFileName = (HiddenField)TemplateContainer.FindControl("hdFileName"); HtmlInputImage btnDelete = (HtmlInputImage)TemplateContainer.FindControl("btnDelete"); HtmlInputImage btnAdd = (HtmlInputImage)TemplateContainer.FindControl("btnAdd"); // В зависимости от того загружен ли файл отображаем контролы if (currentFile != null) { // Получаем ссылку для загрузки файла SPWeb web = SPContext.Current.Site.RootWeb; SPList list = web.GetList(SPUrlUtility.CombineUrl(web.ServerRelativeUrl, libraryName)); SPListItem spFileItem = list.GetItemByUniqueId(currentFile.UniqueID); // Показываем ссылку на файл aFile.NavigateUrl = SPUrlUtility.CombineUrl(web.ServerRelativeUrl, spFileItem.Url); aFile.Text = currentFile.Name; // А в скрытом поле сохраняем UniqueId файла hdFileName.Value = spFileItem.UniqueId.ToString(); } else { // Отображаем сообщение о том, что файл не задан aFile.Text = fileNotExist; hdFileName.Value = String.Empty; } btnDelete.Attributes.Add("onclick", String.Format(@"clearFileValue('{0}','{1}','{2}','{3}');return false;", aFile.ClientID, fuDocument.ClientID, hdFileName.ClientID, fileNotExist)); btnAdd.Attributes.Add("onclick", String.Format(@"changeDisplay('{0}');return false;", fuDocument.ClientID)); fuDocument.Attributes.Add("onchange", String.Format(@"changeFileName(this,'{0}');return false;", aFile.ClientID)); }
/// <summary> /// 控件处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { DataRowView dv = e.Item.DataItem as DataRowView; Int32 id = Convert.ToInt32(dv["id"].ToString()); ImageButton btndel = (ImageButton)e.Item.FindControl("del"); ImageButton btnstatus = (ImageButton)e.Item.FindControl("status"); HtmlInputImage btndetail = (HtmlInputImage)e.Item.FindControl("detail"); btndetail.Attributes.Add("onclick", String.Format("javascript:dialogIFrame({{url:'Books_Edit.aspx?id={0}',title:'详细 - {1}',width:630, height: 450}});return false;", id, dv["title"].ToString())); if (!String.IsNullOrEmpty(dv["ReContent"].ToString())) { btndetail.Src = "../skin/icos/mail_open.png"; } if ((Boolean)dv["status"]) { btnstatus.ImageUrl = "../skin/icos/checkbox_yes.png"; } btndel.OnClientClick = String.Format("javascript:dialogConfirm({{el:this,text:'将删除 {0} 且无法恢复!确定要删除吗?'}});return false;", dv["Title"].ToString()); } }
protected void Page_Load(object sender, EventArgs e) { //if (Session["userauth"] == null ) //{ // Response.Redirect("~/AdminLogin.aspx"); //} if (!IsPostBack) { using (Mybooks mb = new Mybooks()) { List <Book> booklist = mb.Books.ToList(); foreach (Book bookdetail in booklist) { HtmlGenericControl newDiv = new HtmlGenericControl("DIV"); HtmlGenericControl details = new HtmlGenericControl("DIV"); HtmlInputImage image = new HtmlInputImage(); HtmlAnchor anch = new HtmlAnchor(); HtmlAnchor btncart = new HtmlAnchor(); image.Src = "images/" + bookdetail.ISBN + ".jpg"; image.Disabled = true; image.Style.Add("width", "200px"); image.Style.Add("height", "220px"); anch.InnerHtml = "<hr><strong style=\"font-size: 16px;\">" + bookdetail.Title + "</strong><br />"; details.InnerHtml += bookdetail.Author + "<br />"; details.InnerHtml += bookdetail.ISBN + "<br />"; details.InnerHtml += "$ " + bookdetail.Price; newDiv.Attributes.Add("class", "col-xs-12 col-sm-6 col-md-4 well"); newDiv.Style.Add("height", "500px"); newDiv.Style.Add("text-align", "center"); newDiv.Style.Add("padding", "30px"); btncart.InnerText = "Add to Cart"; btncart.Attributes.Add("class", "btn btn-primary"); btncart.Style.Add("position", "absolute"); btncart.Style.Add("top", "86%"); btncart.Style.Add("left", "36%"); btncart.ID = bookdetail.BookID.ToString(); anch.HRef = "~/RegisteredUsers/BookDetails.aspx?id=" + bookdetail.BookID; // user access if (mb.CartBooks.Where(x => (x.UserID == 1) && (x.BookID == bookdetail.BookID)).Count() > 0) { btncart.InnerText = "Already in cart!"; btncart.Style["left"] = "33%"; btncart.Disabled = true; } else if (new Work().CheckStock(bookdetail.BookID) < 1) { btncart.InnerText = "Out of Stock"; btncart.Attributes["class"] = "btn btn-danger"; btncart.Disabled = true; } else { btncart.HRef = "~/RegisteredUsers/ViewCart.aspx?id=" + bookdetail.BookID; } mainDiv.Controls.Add(newDiv); newDiv.Controls.Add(image); newDiv.Controls.Add(anch); newDiv.Controls.Add(details); newDiv.Controls.Add(btncart); } } } else { testlbl.InnerText = "Changed"; } }
private void DrawTable() { decimal total_amount = 0; var read_only = true; if (User.IsInRole(((int)UserRoles.urFSBDAnalystFundsCoordinator).ToString()) && Organization != "") { read_only = false; } else if (!User.IsInRole(((int)UserRoles.urFSBDAnalystFundsCoordinator).ToString())) { var user_role = Users.UserAuthorizedForFSReports(CurrentUserID, BusinessLineCode, Organization); if (user_role <= 0) { throw new Exception("You are not authorized to visit this page."); } else if (user_role == (int)UserRoles.urFSOrgAdminWR && Organization != "") { read_only = false; } } var _add_awards = (AdjustmentsAdditional == "award") ? true : false; var _add_training = (AdjustmentsAdditional == "training") ? true : false; var _add_travel = (AdjustmentsAdditional == "travel") ? true : false; //get the data: var ds = FSDataServices.GetUserEntryData(DataEntryType, FiscalYear, BookMonth, Organization, BusinessLineCode, ReportGroupCode, _add_awards, _add_training, _add_travel, false); HtmlTableRow tr = null; HtmlTableCell td = null; int entry_id; string doc_number; decimal amount; string explanation; string entry_month; //remove first column if there is no permission for edit or delete: if (read_only) { tblData.Rows[0].Cells[0].InnerText = "BookMonth"; } //tblData.Rows[0].Cells[0].AddDisplayNone(); var iRowCount = 0; ds.Tables[0].Columns["Amount"].ColumnName = "$ Amount"; foreach (DataRow dr in ds.Tables[0].Rows) { entry_id = (int)dr["EntryID"]; entry_month = String.Format("{0:MMMM}", DateTime.Parse(dr["BookMonth"].ToString() + "/" + dr["FiscalYear"].ToString())); doc_number = (string)Utility.GetNotNullValue(dr["DocNumber"], "String"); amount = (decimal)dr["$ Amount"]; total_amount += amount; explanation = (string)Utility.GetNotNullValue(dr["Explanation"], "String"); tr = new HtmlTableRow(); tr.AddCssClass((iRowCount++) % 2 > 0 ? "tRowAlt" : "tRow"); if (entry_id >= 0 && !read_only && dr["BookMonth"].ToString() == BookMonth) { td = new HtmlTableCell(); var btnEdit = new HtmlInputImage(); btnEdit.ID = "edit_ctrl_" + entry_id.ToString(); btnEdit.Src = "../images/note.gif"; btnEdit.Alt = "Edit record"; btnEdit.AddOnClick("return edit_row(this," + entry_id.ToString() + "," + DataEntryType.ToString() + ");"); td.Controls.Add(btnEdit); tr.Cells.Add(td); td = new HtmlTableCell(); var btnDelete = new HtmlInputImage(); btnDelete.ID = "delete_ctrl_" + entry_id.ToString(); btnDelete.Src = "../images/btn_contact_delete.gif"; btnDelete.Alt = "Delete record"; btnDelete.AddOnClick("return delete_row(this," + entry_id.ToString() + "," + DataEntryType.ToString() + ");"); td.Controls.Add(btnDelete); tr.Cells.Add(td); } else { td = new HtmlTableCell(); td.ColSpan = 2; td.InnerText = entry_month; tr.Cells.Add(td); } td = new HtmlTableCell(); if (entry_id < 0) { td.InnerHtml = "<font color='green'>Show Details</font>"; td.AddOnClick("Expand(this)"); td.AddTitle("Expand"); td.Style.Add("cursor", "pointer"); } else { td.InnerHtml = doc_number != "" ? doc_number : " "; } tr.Cells.Add(td); td = new HtmlTableCell(); td.InnerText = amount == 0 ? "0" : String.Format("{0:0,0}", Convert.ToInt64(amount)); td.Align = "right"; tr.Cells.Add(td); td = new HtmlTableCell(); td.InnerHtml = explanation != "" ? explanation : " "; tr.Cells.Add(td); tblData.Rows.Add(tr); if (entry_id < 0) //expanded table { tr = new HtmlTableRow(); tr.Style.Add("display", "none"); td = new HtmlTableCell(); tr.Cells.Add(td); td = new HtmlTableCell(); td.ColSpan = 4; var mg = new MultiGrid(); mg = (MultiGrid)Page.LoadControl("..\\Controls\\MultiGrid.ascx"); td.Controls.Add(mg); tr.Cells.Add(td); tblData.Rows.Add(tr); var dtO = FundStatus.GetUserEntryDataList(DataEntryType, FiscalYear, BookMonth, Organization, BusinessLineCode, ReportGroupCode, entry_id).Tables[0]; var dt = dtO.Clone(); dt.Columns["Amount"].DataType = typeof(string); foreach (DataRow r in dtO.Rows) { dt.ImportRow(r); } dt.Columns["Amount"].ColumnName = "$ Amount"; foreach (DataRow r in dt.Rows) { r["Month"] = Month[Convert.ToInt32(r["Month"]) - 1]; r["$ Amount"] = String.Format("{0:0,0}", Convert.ToInt64(Convert.ToDecimal(r["$ Amount"]))); if (r["$ Amount"].ToString() == "00") { r["$ Amount"] = "0"; } } mg.Table = dt; mg.TblCSSClass = "eTbl"; mg.TblBorderClass = "eBorder"; mg.HeaderCSSClass = "reportHeaderGreen"; mg.ItemCSSClass = "eRow"; mg.Height = Unit.Pixel(dt.Rows.Count * 18 + 19); //make it not scrollable by setting full height } } //add row for insert record - if applicable if (!read_only) { HtmlInputText txt; tr = new HtmlTableRow(); tr.AddCssClass((iRowCount++) % 2 > 0 ? "tRowAlt" : "tRow"); td = new HtmlTableCell(); var btnCancel = new HtmlInputImage(); btnCancel.ID = "cancel_ctrl_new"; btnCancel.Src = "../images/back.gif"; btnCancel.Alt = "Cancel changes"; btnCancel.AddWidth(12); btnCancel.AddHeight(12); btnCancel.AddOnClick("return cancel_edit(this);"); td.Controls.Add(btnCancel); tr.Cells.Add(td); td = new HtmlTableCell(); var btnEdit = new HtmlInputImage(); btnEdit.ID = "save_ctrl_new"; btnEdit.Src = "../images/save.gif"; btnEdit.Alt = "Save new record"; btnEdit.AddWidth(12); btnEdit.AddHeight(12); btnEdit.AddOnClick("return save_row(this,0," + DataEntryType.ToString() + ");"); td.Controls.Add(btnEdit); tr.Cells.Add(td); td = new HtmlTableCell(); td.AddStyle("padding-left:5px;padding-right:5px"); txt = new HtmlInputText(); txt.AddStyle("width:100%;height:15px;text-align:center;"); td.Controls.Add(txt); tr.Cells.Add(td); td = new HtmlTableCell(); td.AddStyle("padding-left:5px;padding-right:5px"); txt = new HtmlInputText(); txt.AddStyle("width:100%;height:15px;text-align:center;"); txt.AddOnMouseOut("extractNumber(this,0,true,9999999999);"); txt.AddOnKeyUp("extractNumber(this,0,true,9999999999);"); txt.AddKeyPressBlockNonNumbers(); td.Controls.Add(txt); tr.Cells.Add(td); td = new HtmlTableCell(); td.AddStyle("padding-left:5px;padding-right:5px"); txt = new HtmlInputText(); txt.AddStyle("width:100%;height:15px;text-align:center;"); td.Controls.Add(txt); tr.Cells.Add(td); tblData.Rows.Add(tr); } lblAmount.Text = total_amount == 0 ? "0" : String.Format("{0:$0,0}", Convert.ToInt64(total_amount)); }
public void InstantiateIn(Control container) { switch (_type) { case ListItemType.Header: container.Controls.Add(new LiteralControl("<div style=\"height:250px;overflow-x:scroll;overflow-y:auto;\"><table style=\"widthg:100%\" cellspacing=\"0\">")); var li = new HtmlGenericControl("tr"); container.Controls.Add(li); li.Attributes.Add("style", "font-weight: bold;"); var contentType = new HtmlGenericControl("td") { InnerText = "Content Type" }; contentType.Attributes.Add("style", "width:10em;border-bottom:solid 1px #cccccc;border-right:solid 1px #cccccc;border-left:solid 1px #cccccc;;border-right:solid 1px #cccccc;"); li.Controls.Add(contentType); var type = new HtmlGenericControl("td") { InnerText = "Type" }; type.Attributes.Add("style", "width:10em;border-bottom:solid 1px #cccccc;border-right:solid 1px #cccccc;"); li.Controls.Add(type); var selector = new HtmlGenericControl("td") { InnerText = "Selector" }; selector.Attributes.Add("style", "border-bottom:solid 1px #cccccc;border-right:solid 1px #cccccc;"); li.Controls.Add(selector); var value = new HtmlGenericControl("td") { InnerText = "Value" }; value.Attributes.Add("style", "border-bottom:solid 1px #cccccc;border-right:solid 1px #cccccc;"); li.Controls.Add(value); var actions = new HtmlGenericControl("td") { InnerText = "" }; actions.Attributes.Add("style", "width:60px;border-bottom:solid 1px #cccccc;border-right:solid 1px #cccccc;"); li.Controls.Add(actions); break; case ListItemType.Footer: container.Controls.Add(new LiteralControl("</table></div>")); break; case ListItemType.Item: case ListItemType.AlternatingItem: li = new HtmlGenericControl("tr") { ID = "row" }; container.Controls.Add(li); if (ListItemType.AlternatingItem == _type) { li.Attributes.Add("style", "background-color:#eeeeee;"); } contentType = new HtmlGenericControl("td") { ID = "contentType" }; contentType.Attributes.Add("style", "padding:3px;width:10em;border-right:solid 1px #cccccc;border-left:solid 1px #cccccc;;border-right:solid 1px #cccccc;"); li.Controls.Add(contentType); type = new HtmlGenericControl("td") { ID = "symanticType" }; type.Attributes.Add("style", "padding:3px;width:10em;border-right:solid 1px #cccccc;"); li.Controls.Add(type); selector = new HtmlGenericControl("td") { ID = "selector" }; selector.Attributes.Add("style", "padding:3px;border-right:solid 1px #cccccc;"); li.Controls.Add(selector); value = new HtmlGenericControl("td") { ID = "value" }; value.Attributes.Add("style", "padding:3px;border-right:solid 1px #cccccc;"); li.Controls.Add(value); actions = new HtmlGenericControl("td") { ID = "actions" }; actions.Attributes.Add("style", "padding:3px;border-right:solid 1px #cccccc;"); li.Controls.Add(actions); //Need two buttons edit and delete var editButton = new HtmlInputImage() { ID = "edit" }; editButton.Attributes.Add("class", "micro-data-edit"); editButton.Attributes.Add("style", "padding:5px"); actions.Controls.Add(editButton); var deleteButton = new HtmlInputImage() { ID = "delete" }; deleteButton.Attributes.Add("class", "micro-data-delete"); deleteButton.Attributes.Add("style", "padding:5px"); actions.Controls.Add(deleteButton); break; } container.DataBinding += ContainerOnDataBinding; }