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

[Solved] 'null' is null or not an object

3 Answers 200 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Daron
Top achievements
Rank 1
Daron asked on 30 Apr 2008, 05:20 PM
Friends,

I have a silverlight control that fires the ajaxRequest event of the RadAjaxManager when canvases are clicked.

The problem I'm having, is I get the above error message if I click between the canvases too quickly.

It seems that $find("<%= RadAjaxManager1.ClientID %>") is "null" and that's what's causing the problem.

Has anyone got a solution for how to queue the requests? Is this the reason I'm getting the problem? I would have thought multiple requests would just cancel each other out. I guess it's the fact that RadAjaxManager1 is coming back 'null' that's concerning me the most.

I'm using master pages.

Cheers,
Daron

3 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 01 May 2008, 07:08 AM
Hello Daron,

You're absolutely correct about the subsequent request ignorance -- this is what the MS AJAX does. However, with the official RadControls for ASP.NET AJAX the RadAjax controls introduce a requests queue technique. You can enable it through the RequestQueueSize property.

Also, do you get the error for requests triggered from the silverlight control only? Can you please see if you can reproduce with a standard button for example which triggers the AJAX requests?

Best wishes,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Daron
Top achievements
Rank 1
answered on 01 May 2008, 04:36 PM
Hi Konstantin,
Yes I can trigger the error through "normal" html controls.

Here's my code to replicate:

function performAjaxRequest(senderUniqueId_string, eventArgs_string) //bool  
{  
    //perform ajax:     
    $find("<%= RadAjaxManager.GetCurrent(this).ClientID %>").ajaxRequest(senderUniqueId_string + "|" + eventArgs_string);  
    return true;         
}  
 
<href='#' onclick='performAjaxRequest("<%= DocViewer1.UniqueID %>", "214C3AD2-3C30-4FE1-A430-DDBDB998F54F");'>1</a> 
<href='#' onclick='performAjaxRequest("<%= DocViewer1.UniqueID %>", "E37A98A6-C95C-4AA5-90D4-D1C4A26CFAC5");'>2</a> 

My aspx form is within a masterpage (which is where the AjaxManager is). My js function "performAjaxRequest" simply concatenates the triggering-control's ID with a guid to uniquely identify my record. The server-side "AjaxRequest" grabs information about the record from the database for display on the form.

This only seems to happen when I click fast - ie, before the previous request has completed. If I click one link, wait a couple of seconds and then click the 2nd all seems to work fine. However, if I click the first and then immediately click the 2nd, I get the "'null' is null" exception.

I don't get the exception when I strip my form down to basics (ie, just get it to update a label or something). I have several controls on my form including labels, RadGrids, RadPanelBar, etc...

Any ideas?

Daron
0
Konstantin Petkov
Telerik team
answered on 02 May 2008, 07:40 AM
Hi Daron,

Perhaps disabling the links during the AJAX update would be a solution? The technique is described briefly here.

Best wishes,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Daron
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Daron
Top achievements
Rank 1
Share this question
or