470,848 Members | 762 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

Retain user data in formview after update fails from business layer

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

Please suggest how do we address this issue?

Nov 6 '06 #1
0 1137

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by D Witherspoon | last post: by
2 posts views Thread by headware | last post: by
1 post views Thread by Stuart Ferguson | last post: by
3 posts views Thread by J055 | last post: by
reply views Thread by Chris | last post: by
9 posts views Thread by SAL | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.