动态生成 html控件
我做一个系统 在后天写代码动态生成TextBox和Lable控件 在前台有生成 <input type="txt" />的代码
后天怎么写? 在线等!
[解决办法]
TEXTBOX TB= NEW TEXTBOX();
就这样
[解决办法]
System.Text.StringBuilder s = new System.Text.StringBuilder(); s.Append(@"<input type='text' />").Append(@"<input type='button' value='button' />"); Response.Write(s.ToString());
[解决办法]
HtmlInputText text = new HtmlInputText();
这样就是生成了一个text标记
记得引用:using System.Web.UI.HtmlControls;
[解决办法]
System.Text.StringBuilder s = new System.Text.StringBuilder(); s.Append(@"<input type='text' />").Append(@"<input type='button' value='button' />"); Response.Write(s.ToString());
[解决办法]
TEXTBOX TB= NEW TEXTBOX();
Controls.Add(TB);