Hi...
What I am trying to do is take in data from a database that a user can edit add multiple new rows of data and submit it back to the server.
So a simplified example is this... We have a simple database with a date, Travel Destination, Hotel Name and a tripid for the primary key. This is in a table called BusinessTrip.
What we would like to do is have a user able to either create a new trip or view and edit an existing trip. So if they view an exisiting trip it would bring up day 1 - Date, Travel Destination, Hotel Name then Day 2 - Date, Travel Destination, Hotel Name etc etc. down the page.
To accomplish this we have created a table on the aspx page and manually added rows consisting of cells containing textbox controls in the code behind by capturing the datasource selecting event and populating each text box. We also have a javascript function to dynamically add new rows to the table for extra days they may be travelling. This part works fine however if the user edits any of the text box data or adds new rows and then hits the submit any of the dynamically created data is lost. I have tried catching the datasources updating event and wanted to manually populate the datasource however by this stage I have already lost the data in the dynamically created text boxes. Is there any way of retaining this information from a dynamically created control? IS there any better way of perhaps going about this. We have seen the FormViews edit functions however it seems very annoying that the user has to firstly hit edit and the page refreshes after each row they change and if they add a row the page is updated.
Any help would be appreciated.
Thanks