468,251 Members | 1,383 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,251 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
again.

Please suggest how do we address this issue?

Nov 6 '06 #1
0 1061

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
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.