J
J055
Hi
I have 2 user controls and 1 parent page. One user control contains a
Gridview and the other a FormView. When the GridView row Select command is
fired it bubbles an event to the parent page with the primary key ID of the
row. The parent page sets a property with the ID in the second User control
(FormView) . The FormView then Binds to an ObjectDataSource to select the
record. I don't understand why the events occur as follows:
Begin PreRender
FormView_DataBound
ods_Selecting
ods_ObjectCreating
FormView_DataBound
End PreRender
The first FormView_DataBound is pointless because the ObjectDataSource
hasn't called the SelectMethod yet. What is the best way to handle this to
avoid errors? Why does this happen?
Also I understand the best way to notify the parent page is to raise an
event in the user control. What is the recommended way to notify a user
control that something has happened in the parent page?
Many thanks
Andrew
I have 2 user controls and 1 parent page. One user control contains a
Gridview and the other a FormView. When the GridView row Select command is
fired it bubbles an event to the parent page with the primary key ID of the
row. The parent page sets a property with the ID in the second User control
(FormView) . The FormView then Binds to an ObjectDataSource to select the
record. I don't understand why the events occur as follows:
Begin PreRender
FormView_DataBound
ods_Selecting
ods_ObjectCreating
FormView_DataBound
End PreRender
The first FormView_DataBound is pointless because the ObjectDataSource
hasn't called the SelectMethod yet. What is the best way to handle this to
avoid errors? Why does this happen?
Also I understand the best way to notify the parent page is to raise an
event in the user control. What is the recommended way to notify a user
control that something has happened in the parent page?
Many thanks
Andrew