T
Tomislav Bartolin
Hi,
I have an aspx page which contains an ascx user control.
I am using Page.DataBind in Page_Load event of the page to bind elements to
page properties.
The problem is the ascx uses its Page_Load event to create objects which are
then used
for data binding, but because I call Page.DataBind in the parent page, the
ascx Page_Load event doesn't complete and its objects are null
references, so I get errors.
I have found a workaround for this issue, by using Page_PreRender event do
call Page.DataBind so that the ascx Page_Load event can complete.
I am wondering if this solution is ok,
and is there a way to prevent data binding of some page child controls when
Page.DataBind is called?
Thanks,
I have an aspx page which contains an ascx user control.
I am using Page.DataBind in Page_Load event of the page to bind elements to
page properties.
The problem is the ascx uses its Page_Load event to create objects which are
then used
for data binding, but because I call Page.DataBind in the parent page, the
ascx Page_Load event doesn't complete and its objects are null
references, so I get errors.
I have found a workaround for this issue, by using Page_PreRender event do
call Page.DataBind so that the ascx Page_Load event can complete.
I am wondering if this solution is ok,
and is there a way to prevent data binding of some page child controls when
Page.DataBind is called?
Thanks,