Hi,
I am working on my first web application using ASP.NET. The requirement is as follows:
1. Read Certain rows from DB and dynamically display on the page.
2. Update the values in the web page and update the DB on a button click event.
The controls are simple text boxes and are created dynamically depending on different user actions. Basically, the same page has different number of text boxes based on which user is accessing the website.
I have completed the dynamic population part but not able to think of a way to map the contents of the controls back to the corresponding DB entries.
I am a beginner to this, so any help will be greatly appreciated.
Sample data in DB table UserInfo:
1,1,Name,Peter
1,2,Gender,Male
1,3,UID,100
2,4,FirstName,Mark
2,5,LastName,Harrold
2,6,Occupation,Engineer
2,7,Country,USA
If Peter logs in, the page renders only 3 label-textbox pairs to display Name,Gender,UID
If Mark Harrold logs in, the page renders 4 label-textbox pairs to display FirstName,LastName,Occupation,Country.
At any given point, I have the ID of the user whose data is being updated (1 for Peter, 2 for Mark Harrold) but I am not able to figure out a way to map the label-textbox pairs to the second ID (1-3, 4-7).
Thanks,
Hersh