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

RadAjaxManagerProxy inside a dynamically-loaded User Control is not working

0 Answers 59 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Tyler
Top achievements
Rank 1
Tyler asked on 09 Nov 2017, 11:19 PM

Hey all.

I'm creating a page that is identical to this example:

https://docs.telerik.com/devtools/aspnet-ajax/controls/ajaxmanager/how-to/radajax-and-webusercontrols

In one of my user controls, I have a few controls/buttons that need to be AJAXified. I included a RadAjaxManagerProxy and stripped my example down to its most basic state, which can be seen below.

When a postback is caused, the event is seemingly bubbling up to the container page. In some cases, the entire control flickers. Additionally, I applied some JavaScript that adds text on my user control. When I click the AJAXified RadGrid, the text is gone. This leads me to believe the entire user control is being reloaded, though the ASP controls maintain their values.

 

<telerik:RadGrid runat="server" ID="rgOffers" Skin="Silk" AutoGenerateColumns="false" OnNeedDataSource="rgOffers_NeedDataSource" OnItemCommand="rgOffers_ItemCommand">
            <ClientSettings Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true">
                <ClientEvents OnRowSelected="onOfferSelected" />
            </ClientSettings>
            <MasterTableView>
                <Columns>
                    ...
                </Columns>
            </MasterTableView>
</telerik:RadGrid>

 

<asp:Panel runat="server" ID="pnlSelectedOffer" Visible="false">

    Testing!

</asp:Panel>

 

<telerik:RadAjaxManagerProxy runat="server" ID="ramp">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rgOffers">
            <UpdatedControls>

                <telerik:AjaxUpdatedControl ControlID="rgOffers" LoadingPanelID="ralp" />
                <telerik:AjaxUpdatedControl ControlID="pnlSelectedOffer" LoadingPanelID="ralp" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<telerik:RadAjaxLoadingPanel runat="server" ID="ralp" Skin="Silk"></telerik:RadAjaxLoadingPanel>

 

protected void rgOffers_ItemCommand(object sender, GridCommandEventArgs e)
{

    if (e.CommandName == "RowClick") {

        pnlSelectedOffer.Visible = true;

        RadAjaxManager.GetCurrent(Page).ResponseScripts.Add("alert("clicked.");");

    }

}

No answers yet. Maybe you can help?

Tags
Ajax
Asked by
Tyler
Top achievements
Rank 1
Share this question
or