我有这段代码:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
foreach (Control c in this.Controls)
{
if (c is TextBox && c != null)
((TextBox)c).AutoPostBack = true;
}
}
还有很多:
protected void TextBox1_TextChanged(object sender, EventArgs e)
哪个不会触发,我认为问题是foreach没有将文本框的autopostback设置为true,但我不知道为什么!