How do I get Textbox contents in "code behind" to reflect current "on screen" contents

I am working on a web app using AJAX and the problem is:

Page uses an AJAX control toolkit tabcontainer with two tabs

Tab1 contains a gridview with a list of records

Tab2 contains text boxes reflecting the field contents of the currently selected gridview record on Tab1

All works fine for reflecting the proper contents in the text boxes when the record in the gridview is changed (text boxes not bound... contents updated when the gridview changes using code behind).  For example in the code behind in the index changed event of the gridview, I have code like

Textbox1.Text = (appropriate gridview row/cell text)

This appears to work fine.

There is a webcontrols.button control to "Add" a new record.  This button blanks the fields and positions on the textbox for entering new data, again, using code behind.  For example, in the code behind in the click event of this button, I have code such as:

Textbox1.Text = ""

 I have set a break point in this code and the textboxes reflect the "new blank values" appropriately.

There is a "Save" button for saving the new data.
When I use the click event of the save button to prepare a SQL query for inserting a new record, the textboxes reflect the original content before blanking instead of the "new" data I entered.

What am I missing about the behavior of AJAX and code behind.... It appears the textboxes contain the original information displayed when the form was first loaded, even though I have performed changes to them on the page.
jimnorthAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jimnorthAuthor Commented:
Okay, never mind.... duh!  My PageLoad code that initially populates was NOT surrounded by an

if not is postback.....


Sorry all
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.