I've got an update panel with a repeater and some fields. When a user fills out the details on the fields it populates a collection I keep in the Viewstate which is then bound to the repeater.
So the updatepanel updates and the repeater now contains the new item the values for which the user just filled out in the form.
I've also got an edit button as part of that repeater which, when clicked, populates the form fields with the data the user initially entered.
What I want to do then is for the user to be able to edit this data and 'save' the item, but instead of it being added to the collection / viewstate it edits whatever item the user had chosen and updates the collection / viewstate to reflect that.
For example, imagine a form with two fields:
Name: Age:
I enter Bob and 46 and hit save.
Repeater now shows an entry for Bob 46 with an 'edit' button beside it. User clicks on the edit button and the form fields are populated with Bob and 46 again.
User then changes it to Bob Age 47 and hits save. Now instead of there then being two entries (Bob 46 and Bob 47) - the bob 46 one would be updated to Bob 47.
Hope this is clear, It's a little obscure but I think I've explained the gist of it. Important thing to remember is that this is all happening in the update panel so I'm using Viewstate to contain the collection that populates the repeater.