protected override void Render(HtmlTextWriter w) { HtmlCustomControl topRow = new HtmlCustomControl("tr"); for(int i = 1; i <= 3; i++) topRow.Controls.Add(new HtmlCustomControl("td")); HtmlCustomControl centerRow = new HtmlCustomControl("tr"); for (int i = 1; i <= 3; i++) centerRow.Controls.Add(new HtmlCustomControl("td")); HtmlCustomControl bottomRow = new HtmlCustomControl("tr"); for (int i = 1; i <= 3; i++) bottomRow.Controls.Add(new HtmlCustomControl("td")); base.RenderBeginTag(w); topRow.RenderControl(w); centerRow.Controls[0].RenderControl(w); ((HtmlCustomControl)centerRow.Controls[1]).RenderBeginTag(w); base.RenderContents(w); ((HtmlCustomControl)centerRow.Controls[1]).RenderEndTag(w); centerRow.Controls[2].RenderControl(w); bottomRow.RenderControl(w); base.RenderEndTag(w); }
protected override void Render(HtmlTextWriter w) { base.RenderBeginTag(w); foreach(Control c in Controls) { if (c.GetType().GetInterfaces().Contains(typeof(IQubeFormField))) { HtmlCustomControl lbField = new HtmlCustomControl("label"); lbField.Attributes["for"] = c.ClientID; lbField.Controls.Add(new Literal() { Text = ((IQubeFormField)c).DisplayName + ":" }); lbField.RenderControl(w); c.RenderControl(w); continue; } c.RenderControl(w); } base.RenderEndTag(w); }
protected override void Render(HtmlTextWriter w) { base.RenderBeginTag(w); foreach (Control c in Controls) { Panel p = new Panel(); if (c.GetType().GetInterfaces().Contains(typeof(IQubeFormField)) && c.Parent.GetType() == typeof(QubeStandardPanel)) { IQubeFormField fld = c as IQubeFormField; if(RenderFieldsOuterDiv) p.RenderBeginTag(w); HtmlCustomControl lbField = new HtmlCustomControl("label"); lbField.Attributes["for"] = c.ClientID; lbField.Controls.Add(new Literal() { Text = ((IQubeFormField)c).DisplayName + ":" }); HtmlCustomControl span = new HtmlCustomControl("span"); if (!string.IsNullOrEmpty(fld.DisplayName)) { lbField.RenderControl(w); span.RenderBeginTag(w); } c.RenderControl(w); if (!string.IsNullOrEmpty(fld.DisplayName)) span.RenderEndTag(w); if (RenderFieldsOuterDiv) p.RenderEndTag(w); continue; } else if (c.GetType() == typeof(Captcha)) { if (RenderFieldsOuterDiv) p.RenderBeginTag(w); HtmlCustomControl lbField = new HtmlCustomControl("label"); lbField.Controls.Add(new Literal() { Text = " " }); HtmlCustomControl span = new HtmlCustomControl("span"); lbField.RenderControl(w); span.RenderBeginTag(w); c.RenderControl(w); span.RenderEndTag(w); if (RenderFieldsOuterDiv) p.RenderEndTag(w); } else c.RenderControl(w); } base.RenderEndTag(w); }