Of course the server side still have an old value. You never sent any HTTP request to the server side during all you jQuery manipulation. The missing link is Ajax HTTP request to be sent via jQuery. Something like:
$.post(
'myPage.aspx',
{
type: "textbox-text-updated",
textBoxText: newText
},
function(data) { }
);
Your server-side code should extract new value from HTTP request by the key and remember new value for the
TextBox.Text
.
[EDIT] Please remember that it will send the 'post' HTTP request asynchronously; it means that on the return from
$.post
the post is generally not yet processed, so if you need to handle the result of the post, it can be reliably done only in the callback shown above, which is called only when the server's response is already received.
—SA