if i have a label with text initially and i would like to update the label's text with a textbox.text.. how should i do that?
On server side,
Label1.Text = Textbox1.Text;
On client side (via JS),
document.getElementById('[Label1 Client Id]').innerHTML = document.getElementById('[Textbox1 Client Id]').value;
BTW, even if you change the label client side, it would be restored to original value on post-back so you should change it on server side as well as.
If you want to change the text on textbox text change event then you have to do that using javascript.
But if you want to do that on button click event then please use the button and on the button click event use this code in code behind.
Label1.Text = Textbox1.Text;
精彩评论