Determine which one of 50 dynamicly created textboxes has chnaged

eramgarden

Contributor
Joined
Mar 8, 2004
Messages
579
I have dynamically created 50 textboxes, populated them with data from database. Now, when one field is changed, i want to update the database.

What's the best way of determining what field was changed?

my idea is to hold the Orig values from the database in session variables...then when user clicks "update", I compare ALL the old values (in the session variables) to ALL the current textbox values..
I think this is doable but tedious

Any ideas?
 
i use a procedure where i compare the go through all the textboxes and compare the unique id while counting each time so when they are the same & it stops, that integer is the index. it's a little tedious also tho.
 
Use a dataset and simple bind your data to the textboxes. Updates will persists any changes back to the database source.

Check Wrox Press: Beginning ASP.NET Databases using VB.NET walks you through it step by step.

Jon
 
Last edited:
why dont you save all the values within the textboxes back to the database? Anyways u gotto have O(n) to traverse all the textboxes.

Im not sure if I've understood your problem correctly.
 
Back
Top