all groups > asp.net > january 2006 >
You're in the

asp.net

group:

Get data, make textBoxes, edit values, and re-save to database. Simple?


Get data, make textBoxes, edit values, and re-save to database. Simple? \
1/31/2006 11:55:36 PM
asp.net:
I'm using asp.net/vb.net/ado.net to create a very simple user interface.
(Everything works if I use STATICALLY created textBoxes... but not when I
make them DYNAMICALLY.)

1. Execute a SQL SELECT cmd to retrieve a record.

2. Loop through the dataReader values, creating textBox boxes dynamically,
adding them to a Panel.
(The database values are placed in these textboxes.)

3. Allow the user to edit 1 of the values in 1 of the textboxes.

4. When he hits the SUBMIT button... it saves his changes back to the
database with an UPDATE command.

I seem to have everything working... but the values that are getting stored
at the *ORIGINAL* values
(not the new ones that user typed in.)

Seems like I can't get dynamically created controls to return the user's
*NEW* values back to the database.

Help!

Re: Get data, make textBoxes, edit values, and re-save to database. Simple? ray.bradbury9 NO[at]SPAM gmail.com
2/1/2006 12:11:34 AM
IMHO it seems that you can have done any of these two things:

1.- You create the textboxes and fill the original data in every load
of the web page. Page.IsPostBack missing in the Page_Load?
2.- You may have to add the control to the viewstate.

Anyway, I haven't done any test and you have posted no code, so nothing
is sure.

[quoted text, click to view]
AddThis Social Bookmark Button