textbox.

  • Thread starter Thread starter Joriz
  • Start date Start date
J

Joriz

i have a textbox that i need to edit. First i populate it with the
data from my sql table. afterwards i make changes on them.. and then
when i clicked the save button, i noticed that the textbox value still
contains the original value. the changes i made on the textbox wasnt
saved at all.. The textbox.text was part of my UPDATE statement.


anybody??
TIA.
 
Without seeing the code, I can make a guess...

Are you, by chance, populating the textbox with text from the database
BEFORE your UPDATE statement? Just for testing, try using
Request.Form("textboxname") in your UPDATE statement instead of
textbox.text. If my above guess is correct, this will sort-of fix it. I
say sort-of because after submitting the page, the text box will still show
the original value - it will only show the new value on subsequent page
views. To fix this, reset the textbox.text value to
Request.Form("textboxname") after the UPDATE statement as well.

If you work out that this is indeed the problem, you can restructure the
order of your function calls. Or, if it's too much hassle to change
everything, you can just implement the above example and leave it alone! ;)

Eric
 
thanks Eric..
i had a careless mistake. coz i did it in load event. i forgot to put
a IsPostBack. Thats why everytime my page loads, the changes i made
were overwritten by the original values. and by the time the update
statements occurs its all already in its original value.

sorry for that...
 

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

Back
Top