When Updating using a FormView and ObjectDataSource, the formview
always does the data-binding of its controls and the field values in
the FormView are always overwritten by the results of the Update
method. This behavior is fine when update method succeeds.
But the problem is that when for some reason (e.g. a business rule
"start date can not be prior to 1/1/2006") business layer rejects
the data and Update method returns False (or throws an exception), then
even after the update function has failed, the formview re-binds itself
and all the data entered by user is replaced with data in database (as
it was before the edit).
The point is that user should be able to change the data, when it is
invalid and not forced to re-enter all information, including the
values that were correct but did not get saved to the database. In
this case, formview should be constructed from the viewstate so that
all user data is there and he gets another chance to correct and update
again.
Please suggest how do we address this issue?