This is a migrated thread and some comments may be shown as answers.

Ajaxifing ITemplate programmatically

1 Answer 43 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Igor
Top achievements
Rank 2
Igor asked on 30 Jan 2014, 11:27 AM
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 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 04 Feb 2014, 10:36 AM
Hi Igor,

Could you please try to add the needed settings in the "CreateChildControls" setting of the composite control as shown in the help topic below:
 http://www.telerik.com/help/aspnet-ajax/ajax-update-in-composite-control.html

and verify if this helps.

Regards,
Maria Ilieva
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Ajax
Asked by
Igor
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
Share this question
or