Also, why does the form View_Item Created event occur before the Page_Load event on the update?
Where can I check a return value to determine if the record was successfully updated?
I have a page with a Form View that opens in edit mode by default .
The Form View is tied to an Object Data Source and when the page loads initially, here are the events that are fired in the order that they are fired: form View_Init object Data Source_Init Page_Load form View_Load object Data Source_Load object Data Source_Object Creating object Data Source_Object Created form View_Data Binding form View_Item Created form View_Data Bound form View_Pre Render Makes sense to me, but when I change a field and click the update button, the following events are fired: form View_Init object Data Source_Init form View_Item Created Page_Load form View_Load object Data Source_Load form View_Item Command form View_Item Updating object Data Source_Updating object Data Source_Object Creating object Data Source_Object Created object Data Source_Updated form View_Item Updated object Data Source_Object Creating object Data Source_Object Created form View_Data Binding form View_Item Created form View_Data Bound form View_Pre Render There are more events that fire, but understanding the events above will help me figure the rest out...
Problem found: There was a Validator in the Form View, this Validator (along with its associated input Text Box) was ocassionaly set to Invisible.
However, although the Validator was set to Invisible, the underying validation still took place upon 'Update' button click.
(3b) Then I copy and paste the exact coding from the problem aspx to ....this modified works, to my amazement !!! This aspx works......until not knowing when.....update command problem happen again.
Work around I am going to do: Programmatically fill in datasource's parameters and promatically invoke datasource's updating event. But I am so reluctant because with so many aspx I have written, I know ASP.
I wish the Form View would set this automatically then, but I suppose that's too much to ask...
When I finally resort to set the Update Method's parameter manually, everything works!
This is a strong evidence of such a possible exception.
What I have done to narrow down the problem: (1) Replace Object Data Source with an equivalent Access Data Source : same problem.
(2) Check that sequence, parameter names and number of Bind("xxx") in Edit Item Template is identical to Object Data Source's parameter collection (3a) Create a new Test.aspx, using Access Data Source, update command works.