public partial class _Default : System.Web.UI.Page
{
TextBox tb = new TextBox();
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(tb.Text);
} protected void Button1_Click(object sender, EventArgs e)
{
form1.Controls.Add(tb);
}
}
添加 button1 button2
点击了button1 生成textbox 输入helloworld 又点击button2 期待出现 helloworld 但是无显示
postback后 控件属性值如何取得
{
TextBox tb = new TextBox();
protected void Page_Load(object sender, EventArgs e)
{
Response.Write(tb.Text);
} protected void Button1_Click(object sender, EventArgs e)
{
form1.Controls.Add(tb);
}
}
添加 button1 button2
点击了button1 生成textbox 输入helloworld 又点击button2 期待出现 helloworld 但是无显示
postback后 控件属性值如何取得
试试