RE: FormView, ObjectDataSource and the evil binding

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi KaOne,

From your description, you're using some custom BLL component class to
access database for query/updating. And you use Objectdatasource to connect
them with ASP.NETT 2.0 Formview control. However, since the update method
of BLL class will indicate concurrent update error as return value, it will
be too late to inform FormView not to change status, correct?

Based on my understanding, if your concurrent update error is not raised as
exception , but an normal return code, the FormView will treat the update
command as success and change the mode. I think you can have test on the
following things:

The FormView control has a "ModeChanging" event, you can add handler and
print some statement in it to see whether it occurs before your BLL
component class return update result. If you can get the update result
first, then you can mark a flag in a page variable or any other place. In
the Modechanging event, you can cancel the mode changing.

Also, another means is we manually do the update instead of using the
FormView's updating command(use another postback button that doesn't use
"Update" as command name), and only when the update succeed will we
manually call FormView's ChangeMode method to change the current mode. How
do you think?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.

.


Quantcast