RadAjaxManager with AjaxUpdateControl does not fully load UserControl Dynamically

2 posts, 0 answers
  1. Ertan
    Ertan avatar
    2 posts
    Member since:
    Mar 2013

    Posted 19 Jun 2014 Link to this post

    Hi, I am using RadAjaxManager with AjaxUpdateControl in my project to update panels and controllers. The task is simple, I need to choose from initial buttons to load necessary objects to datalist and asp:panel. The panel will contain dynamic usercontrol from different projects. My settings are like this;

    <telerik:RadScriptManager ID="RadScriptManager" runat="server" EnablePartialRendering="true"  />
        <telerik:RadAjaxManager ID="RadAjaxManager" runat="server" >
            <ClientEvents OnResponseEnd="onResponseEnd" OnRequestStart="onRequestStart"/>
            <AjaxSettings >
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager">
                <UpdatedControls>
                     <telerik:AjaxUpdatedControl ControlID="listInjectors" />
                     <telerik:AjaxUpdatedControl ControlID="injectorsTemplate"/>
                   </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>


    I have a datalist with items, in javascript of that item onclick i invoke RadAjaxManager to send a ajax request and depending on that i will update listInjectors and injectorsTemplate. When I complete the action it is ok that i can see new interface is changed but there is no javascript binding or button events are working. Also in my every UserControl I have different javascript source which are added with optimization Script.Render(~/xyz.js). After the operation I can see that that file is not loaded. I have buttons radiobuttons and textboxes in the usercontrol and non of their validation nor onclicks are working. 

    Can you please explain why?
    Thanks,


  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 23 Jun 2014 Link to this post

    Hello Ertan,

    If you would like to load user controls dynamically and use RadAjaxManager you could follow an approach similar to the one described in this article. It illustrates how a user control could be loaded after a button click.

    Regarding the client side scripts. Please note that when you have JavaScript that is evaluated on Ajax request you need to wrap the code in a RadScriptBlock. Check this article that elaborates more on the use of RadScriptBlock and RadCodeBlock.

    In case there are some controls that are not updated after Ajax please take a look at this article that lists common reasons for such behavior. It also suggests solutions that could be used to resolve the issues.



    Regards,
    Viktor Tachev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top