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

RadAjaxManagerProxy within Control error

1 Answer 52 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 06 Mar 2017, 08:51 PM

Hi, I'm trying to use RadAjaxManagerProxy  within a control, following this: http://docs.telerik.com/devtools/aspnet-ajax/controls/ajax/radajaxmanagerproxy/overview

In the ascx, I have the proxy:

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnCal">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadScheduler1"></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="RadScheduler1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" UpdatePanelCssClass="" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

In the code behind I have in the page load:

       RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
        manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManager1_AjaxRequest);

and:

    protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
            RadScheduler1.Rebind();
        }
    }

which produces the errors:

Object reference not set to an instance of an object.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error: 

Line 21: RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);

Line 22: manager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManager1_AjaxRequest);

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 09 Mar 2017, 02:12 PM
Hi David,

Please make sure that you have RadAjaxManager on the main aspx web page:
http://docs.telerik.com/devtools/aspnet-ajax/controls/ajax/radajaxmanager/how-to/radajax-and-webusercontrols

That should resolve the issue.

Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Ajax
Asked by
david
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or