M
mcollier
I'm trying to develop a page template for the ASP.NET 1.1 project I'm
working on. I want to have something like Master Pages (from ASP.NET
2.0). I'm having a problem now with databinding on a simple DataGrid.
When the page, PlanCopySelection2.aspx, loads initially it loads, and
data binds, correctly. This page has a few checkboxes in the DataGrid.
When I submit the page and handle the click event, I'm losing the line
items in the DataGrid. I think this is because the
CreateChildControls() function is being invoked, and the
ChildControlsCreated property is false. This caused the
MainContentTemplate to databind again, and I believe, all controls
under the MainContentTemplate. Thus, the DataGrid is rebound and all
the items are cleared. Hopefully I'm making some sense here.
I know one work-around is to not check the IsPostBack property on
PlanCopySelection2.aspx. That would allow all the databinding on the
DataGrid to occur again. This is unnecessary I think. I would like to
understand why this is all occuring. I think I'm just missing
something in the event flow of the page and subsequent controls. I'm
wondering if I need to do something with the databinding events
(OnDataBind() perhaps).
If you're interested in the source code, please respond and I'll be
happy to email you the code.
Thanks
working on. I want to have something like Master Pages (from ASP.NET
2.0). I'm having a problem now with databinding on a simple DataGrid.
When the page, PlanCopySelection2.aspx, loads initially it loads, and
data binds, correctly. This page has a few checkboxes in the DataGrid.
When I submit the page and handle the click event, I'm losing the line
items in the DataGrid. I think this is because the
CreateChildControls() function is being invoked, and the
ChildControlsCreated property is false. This caused the
MainContentTemplate to databind again, and I believe, all controls
under the MainContentTemplate. Thus, the DataGrid is rebound and all
the items are cleared. Hopefully I'm making some sense here.
I know one work-around is to not check the IsPostBack property on
PlanCopySelection2.aspx. That would allow all the databinding on the
DataGrid to occur again. This is unnecessary I think. I would like to
understand why this is all occuring. I think I'm just missing
something in the event flow of the page and subsequent controls. I'm
wondering if I need to do something with the databinding events
(OnDataBind() perhaps).
If you're interested in the source code, please respond and I'll be
happy to email you the code.
Thanks