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

Javascript failure: Uncaught TypeError: Cannot read property 'id' of undefined

4 Answers 892 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 30 Nov 2011, 02:15 AM
Hi

I just started a new project were ASP.NET Ajax Teleriks components are used.
We use a RadGrid to present the result of a db search and a simple ASP.NET Button ctrl to submit the search. This button is, as I understand it, ajaxified:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"
        DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
             <telerik:AjaxSetting AjaxControlID="buttonSearch">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgCustomers" />
                </UpdatedControls>
            </telerik:AjaxSetting>  
            ....

rgCustomers is the ID of the RadGrid ctrl.

When this button is pressed on error occurs:
Uncaught TypeError: Cannot read property 'id' of undefined
The callstack is:

            Telerik.Web.UI.RadAjaxControl._initializeRequestScriptResource.axd:107
   Type$callBaseMethodScriptResource.axd:1261
   Telerik.Web.UI.RadAjaxManager._initializeRequestScriptResource.axd:662
   $type.createDelegateScriptResource.axd:628
   $type.getHandlerScriptResource.axd:4338
   Observer$raiseEventScriptResource.axd:2685
   PageRequestManager$_onFormSubmitScriptResource.axd:1355
   PageRequestManager$_doPostBackScriptResource.axd:911
   $type.createDelegateScriptResource.axd:628
   WebForm_DoPostBackWithOptionsWebResource.axd:42
   PageRequestManager$_doPostBackWithOptionsScriptResource.axd:916
   $type.createDelegateScriptResource.axd:628
   (anonymous function)Customers.aspx:1217
          onclick

and the RadGrid is not updated dispite that AjaxRequest event fired, an updated datasource was set and DataBind() method of the RadGrid ctrl was called.

I should say that everything works if you tab to the button and then press enter. And after this even mouse clicks works.
Problem seem to occur using all browsers (IE,FF,chrome)

Any ideas?

Thanks

4 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 02 Dec 2011, 04:46 PM
Hello Michael,

I looked through your code and I cannot see an obvious reason for the described issue.
You can see how similar code works here.

If the issue persists, I suggest that you open a formal support and send us a small working project, demonstrating your full setup and showing the unwanted behavior.
We will debug it locally and get back to you with our findings.

Best wishes,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Michael
Top achievements
Rank 1
answered on 05 Dec 2011, 04:53 AM
Hi, I could send you the source code (aspx and code behind), but the datasource is a .mdf file of ~1 GB, and I really wouldn`t know how to shrink that.

Possible for you guys to have a look without the datasource? (you would not be able to debug)

/Michael
0
Michael
Top achievements
Rank 1
answered on 05 Dec 2011, 06:14 AM
..ans I also tried to unajaxify the page by removing the AjaxManager. Now the button works great, but perhaps the performance of the page got somewhat worse.

However, now the calls window.radopen() starts to fail instead :(. It tries to open a window on the same page, but then window disappears.
Without any error prints shown in the debugger. Tips?

Is this functionality dependent on having a AjaxManager elem on the page? The only thing I changed...


0
Mira
Telerik team
answered on 07 Dec 2011, 11:29 AM
Hello Michael,

Please follow the steps from the Isolating a problem in a sample project blog post in order to prepare a runnable sample. Then, you can open a formal support ticket and attach it in it.

However, I do not assume that the problems are caused by the AJAX manager.

Best wishes,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Mira
Telerik team
Michael
Top achievements
Rank 1
Share this question
or