W
william.oram
Suppose I have a button that, when pressed, takes the current value of
TextBox.Text pulled from SQL and sends it to Label1.Text. This code
should be:
private void update_Click(object sender, System.EventArgs e)
{
Label1.Text = TextBox1.Text;
}
As the program currently runs, clicking the button sends TextBox's
*first* value to Label1, not what was typed over it. That is, if
TextBox initially reads 'porkchop', change it to 'sandwiches' and
click the button, the label will read 'porkchop.'
My only idea of a solution is toggling AutoPostBack, but that didn't
help any. What else can I try?
Thanks.
TextBox.Text pulled from SQL and sends it to Label1.Text. This code
should be:
private void update_Click(object sender, System.EventArgs e)
{
Label1.Text = TextBox1.Text;
}
As the program currently runs, clicking the button sends TextBox's
*first* value to Label1, not what was typed over it. That is, if
TextBox initially reads 'porkchop', change it to 'sandwiches' and
click the button, the label will read 'porkchop.'
My only idea of a solution is toggling AutoPostBack, but that didn't
help any. What else can I try?
Thanks.