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

RadAjaxManager with AjaxUpdateControl does not fully load UserControl Dynamically

1 Answer 54 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Ertan
Top achievements
Rank 1
Ertan asked on 19 Jun 2014, 07:25 AM
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,


1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 23 Jun 2014, 03:13 PM
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.

 
Tags
Ajax
Asked by
Ertan
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or