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

[Solved] "Object reference not set to an instance of an object."

2 Answers 236 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Konstantin
Top achievements
Rank 1
Konstantin asked on 20 Mar 2008, 04:54 PM
Hello,

I have got a page with several dynamically loaded user controls. Each of the controls has an RadAjaxPanel inside.

The page by itself does not contain any AjaxPanels. Controls are being added each time the page is requested (get or post) in PageInit.

If I click a button on a page and inside the server side ButtonClick try to remove all dynamically added controls and then add them back, I get an exception of this type later on during the PreRender:

Object reference not set to an instance of an object. at Telerik.Web.UI.RadAjaxControl.OnPagePreRender(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Control.OnPreRender(EventArgs e)

Regards,
Konstantin

2 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 21 Mar 2008, 06:38 AM
Hi Konstantin,

First of all, can you check if you use the latest RadControls Prometheus version labeled 2007_3_1425? Please, make sure you have the latest so you don't hit an already addressed problem.

If that does not help, I believe it will be best if you assemble a simple working project reproducing the issue. You can submit a regular support ticket to send the sample so that we can debug it locally and provide resolution.

Best wishes,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Konstantin
Top achievements
Rank 1
answered on 01 Apr 2008, 01:59 AM
Thank you for the reply.

I was using the latest version of telerik dll, and what I had is the following:
1 big user control that dynamicly creates lots of rad tooltips in Init. Each tooltip had another dynamicly loaded user control inside with a a rad ajax panel inside and inunder some conditions (Button_Click, remove all dynamic controls, render them back) I was receiving the exception I mentioned.

But eventually I realized that I can implement what I wanted a bit easier and got rid of ajax panal inside the tooltips, moving it to the whole page. There is a chance that my code was incorrect somewhere and this caused the exception from my original post. In any case, I am no longer facing that problem.

Tags
Ajax
Asked by
Konstantin
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Konstantin
Top achievements
Rank 1
Share this question
or