New TextBox value ignored

A

Andy Ogden

I am using a datagrid and using an edit template to update one of the
rows. The code below comes from the Update method that I have written.
The original value of the row appears in the edit box, I then update
this to the new value. When I click update, the new value is ignored
and the original value is used in the code. The code below is
supposed to get the new value of the textbox and display it in the
label, only the original value is displayed.

TextBox EditText= null;
EditText= (TextBox)e.Item.FindControl("txtText");
MyLabel.Text="You changed text to " + EditText.Text;

This is really annoying because I am using the same method to retrieve
the value to insert into the database, the update works fine as I am
able to hard code a string to be inserted.

What am I doing wrong ?

Please help

Cheers

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top