Ajaxifing ITemplate programmatically

2 posts, 0 answers
  1. Igor
    Igor avatar
    24 posts
    Member since:
    May 2013

    Posted 30 Jan 2014 Link to this post

    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


    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.
  2. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 04 Feb 2014 Link to this post

    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:

    and verify if this helps.

    Maria Ilieva
    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.
Back to Top