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

AddAjaxSetting Object reference not set to an instance of an object

3 Answers 151 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 15 Dec 2011, 03:34 PM
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

3 Answers, 1 is accepted

Sort by
0
Jonathan
Top achievements
Rank 1
answered on 15 Dec 2011, 04:21 PM
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
0
Robert Helm
Top achievements
Rank 1
answered on 23 May 2012, 05:35 PM
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.



0
Blop
Top achievements
Rank 1
answered on 24 May 2012, 03:29 PM
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?
Tags
Ajax
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Jonathan
Top achievements
Rank 1
Robert Helm
Top achievements
Rank 1
Blop
Top achievements
Rank 1
Share this question
or