Last post Feb 11, 2011 09:41 PM by decker dong - msft
Feb 11, 2011 02:06 PM|mr_breaker|LINK
Hi, I have a DetailsView control bound to an ObjectDataSource within a User Control (.ascx). It appears that the DetailsView.OnDataBound event is being fired on every page load or postback.
I do not see this behavior with a similiar DetailsView directly placed on an aspx page.
Is there any way to fix this behavior? It's causing a number of problems.
Feb 11, 2011 09:41 PM|Decker Dong - MSFT|LINK
According to my limit experience. I think if you call page's DataBind() method, all the controls inside the Page will be DataBind automatically. So my suggestion is that you should Call Page.Databind() or the UserControls' DataBind() in the if(!IsPostBack)｛……｝block
in either page_load event of your aspx page as well as in your own usercontrol's Page_Load event.