Hello, I have successfully programmatically ajaxified many composite controls, using the following steps:
1. Inside MyCompositeControl.OnInit: subscribe to Page.PreRender event
2. Inside Page.PreRender event: call AddAjaxSetting on desired child controls
Good!
Now I have a problem because one of my child controls is a FormView and inside I have a ITemplate derived class with many controls.
I’m not able to ajaxify these controls inside ITemplate.
The problem comes from the page lifecycle, that is:
1. MyCompositeControl.OnInit
2. Page.PreRender
3. ITemplate.InstantiateIn
So, during Page.PreRender it’s too early to ajaxify ITemplate subcontrols, because they are not yet created.
But Ajaxifing them at the end of ITemplate.InstantiateIn throws a System.ArgumentNullException.
1. Inside MyCompositeControl.OnInit: subscribe to Page.PreRender event
2. Inside Page.PreRender event: call AddAjaxSetting on desired child controls
Good!
Now I have a problem because one of my child controls is a FormView and inside I have a ITemplate derived class with many controls.
I’m not able to ajaxify these controls inside ITemplate.
The problem comes from the page lifecycle, that is:
1. MyCompositeControl.OnInit
2. Page.PreRender
3. ITemplate.InstantiateIn
So, during Page.PreRender it’s too early to ajaxify ITemplate subcontrols, because they are not yet created.
But Ajaxifing them at the end of ITemplate.InstantiateIn throws a System.ArgumentNullException.