日期:2014-05-17 浏览次数:21164 次
System.Web.UI.WebControls.Label lb = new System.Web.UI.WebControls.Label();
lb.ID = "Label" + i;
divs.Controls.Add(lb);
Label lbl = new Label();
lbl.Text = "测试下自定义控件";
this.Controls.Add(lbl);
BR br = new BR();
this.Controls.Add(br);
class BR : Control
{
protected override void Render(HtmlTextWriter writer)
{
writer.Write("<br />");
}
}
<span>测试下自定义控件</span><br />
System.Web.UI.WebControls.Label lb = new System.Web.UI.WebControls.Label();
lb.ID = "Label" + i;
divs.Controls.Add(lb);
divs.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("br"));