System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
System.IO.StringWriter stringWriter = new System.IO.StringWriter(stringBuilder);
System.Web.UI.HtmlTextWriter htmlTextWriter = new System.Web.UI.HtmlTextWriter(stringWriter);
TextBox tb = new TextBox();
tb.ID = "t1";
tb.Text = "text1";
tb.Width = 1000;
tb.RenderControl(htmlTextWriter);
string a = stringBuilder.ToString();