AddAjaxSetting Object reference not set to an instance of an object

4 posts, 0 answers
  1. Jonathan
    Jonathan avatar
    33 posts
    Member since:
    Jan 2011

    Posted 15 Dec 2011 Link to this post

    Hi

    I am currently working on upgrading our application to your latest controls. We are moving from using Telerik.WebControls (Class controls) to the Telerik.Web.UI (Ajax controls)

    I have got the application compiling and I am working through the errors the application is throwing.

    I have come into a stumbling block when the pages load which contain the below syntax:

    RadAjaxManager.AjaxSettings.AddAjaxSetting(RadAjaxManager, updatePanel, AjaxLoadingPanel);

    Obviously the parameters that are passed are different between pages however i am constantly getting an Object reference not set to an instance of an object error message and have been unable to find any relevant help on this.

    The AddAjaxSetting is varying between being defined in the Page_Load, On_Init and On_PreRender methods.

    If you need any more information please let me know.

    Regards,
    Jonathan

  2. Jonathan
    Jonathan avatar
    33 posts
    Member since:
    Jan 2011

    Posted 15 Dec 2011 Link to this post

    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.] Telerik.Web.UI.AjaxSettingsCollection.AddAjaxSetting(Control ajaxifiedControl, Control updatedControl, RadAjaxLoadingPanel loadingPanel, UpdatePanelRenderMode renderMode, Unit updatePanelHeight) +191 Telerik.Web.UI.AjaxSettingsCollection.AddAjaxSetting(Control ajaxifiedControl, Control updatedControl, RadAjaxLoadingPanel loadingPanel, UpdatePanelRenderMode renderMode) +50 Telerik.Web.UI.AjaxSettingsCollection.AddAjaxSetting(Control ajaxifiedControl, Control updatedControl, RadAjaxLoadingPanel loadingPanel) +15 Hexagon.Web.UI.Generic.List.CommonViewBase.OnPreLoad() in C:\TFS\Development\3G\Branches\HeadBranches\Support\Hexagon3.5 Optimized\ASP.NET\WebApplication\Generic\List\CommonViewBase.cs:268 Hexagon.Web.UI.Generic.List.GenericItemView.Page_PreLoad(Object sender, EventArgs e) in C:\TFS\Development\3G\Branches\HeadBranches\Support\Hexagon3.5 Optimized\ASP.NET\WebApplication\Generic\List\GenericItemView.ascx.cs:759 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Page.OnPreLoad(EventArgs e) +111 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +554
  3. Robert Helm
    Robert Helm avatar
    54 posts
    Member since:
    Feb 2009

    Posted 23 May 2012 Link to this post

    I had the same problem, but when I moved my code (RadAjaxManager.AjaxSettings.AddAjaxSetting(RadAjaxManager, updatePanel, AjaxLoadingPanel);) from Page_Init() to Page_Load(), everything worked fine.



  4. Blop
    Blop avatar
    19 posts
    Member since:
    Feb 2012

    Posted 24 May 2012 Link to this post

    I exactly have the same problem... I'm doing the same things that this page http://www.telerik.com/help/aspnet/ajax/ajxmasterpageupdateeverywhere.html 

    But it always this message... Object reference not set to an instance of an objec

    I tried to put this line:  AjaxManager.AjaxSettings.AddAjaxSetting(btnAdd, lblCount, Nothing)

    into page_load and page_init but always the same probleme... 
    I noticed that when i'm doing: Dim lblCount As Label = CType(Master.FindControl("lblCount"), Label) on page load of my page it doesnt give the the text. On the load of the masterpage the label recieved a value, but it is not recognize with the load of my page...


    Any idea what might be wrong?
Back to Top