We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Grids in UpdatePanel after add or update produce a JavaScript runtime errors

Thread ID:

Created:

Updated:

Platform:

Replies:

121723 Jan 19,2016 01:08 PM Jan 22,2016 07:22 AM ASP.NET Web Forms 3
loading
Tags: Grid
Bruce Stevenson
Asked On January 19, 2016 01:08 PM

Thanks for your assistance in advance.

I have an accordion control holding different elements of an order, four elements are represented in ej:grids surrounded by update panels.  Two of the grids are using templates for editing the others are inline editing, so I am using the grid as the control that triggers the update.

When I preform an, add, update or delete I get this javascript error after my java executes:

JavaScript runtime error: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'XXX'. If it is being updated dynamically then it must be inside another UpdatePanel.

I have looked at forums/121150/grid-custom-command-save-edit-grid-refresh-page but this did not solve my problem, and other examples use buttons.  I have added outside update panels but the error message remains unchanged.

can you point me to what I am missing:

Bruce


Attachment: XEditOrder_a957b7e4.zip

Sellappandi Ramu [Syncfusion]
Replied On January 20, 2016 03:55 AM

Hi Bruce,

Thanks for contacting Syncfusion support.

We have analyzed the reported issue at our end and found this can be caused by unclosed tag or missing end tag. When we use multiple update panel need to consider doing an asynchronous post back.

Please refer the online forum link,

http://stackoverflow.com/questions/3928253/could-not-find-updatepanel-with-id-xxx-if-it-is-being-updated-dynamically-the

http://forums.asp.net/t/1046285.aspx?Sys+InvalidOperationException+when+using+UpdatePanel

Note: We are unable to execute provided codes at our end, but we found that you have missed to use IsPrimaryKey property to ReferencesGrid and ContactsGrid.

We are unable to edit any row except the first row value in Grid, if isPrimaryKey property is not set to the primary key column. Please refer the knowledge base documentation.

KB: https://www.syncfusion.com/kb/2675/cant-edit-any-row-except-the-first-row-in-grid

Could you please share the following information to us, it will help us to provide the prompt solution.
1.       Check whether the reported issue reproduced in single grid with single UpdatePanel tag in your sample. Because we have created a sample with update panel but we are unable to reproduced.
2.       Check whether the reported issue occurred once removed the UpdatePanel tag in your sample.
3.       Kindly provide issue reproducing sample which is runnable mode with replication procedure.


Regards,
Sellappandi R


Bruce Stevenson
Replied On January 21, 2016 10:18 AM

Great suggestions;

I had seen the stackoverflow post, and re-examined it then viewed the post that linded to an additional support ticket and read all of that.  I had not see the Microsoft post, but it ended up with the same resolution for the situation that most closely resembled mine.
I built a new page not using the Accordion in the project to test the cross links between the grids and they all worked as designed.

I extended the solution from "Direct-Trac technical support incident 146633" (Add a summary to an Accordion control) to move the new div's into place with the same logic, then modified the onActive and onInActive functions to set the display the divs accordingly on the user input.

Q1 - all 5 grids contained in a <ContentSection> where experiencing the  JavaScript runtime error.
Q2 - the page was originally built with out the updatepanels, the functionality was ported from other pages where they had been developed, this chused a refresh issue removing data updates from the other content sections.
Q3 - it would take considerable time to build this page with simple supporting class structures.

my solution :
(Javascript:)
$(function () {
            $("#OrderAccordion .e-content").each(function (length) {
                var summary = '#s' + Accordion_content(length);
                var content = '#D' + Accordion_content(length);
                if (length == 0) {
                    $(summary).insertAfter($("#OrderAccordion .e-content")[length]);
                    $(summary).hide();
                    $(content).insertAfter($(summary));
                    $(content).show();
                }
                else {
                    $(summary).insertAfter($("#OrderAccordion .e-content")[length]);
                    $(content).insertBefore($(summary));
                }    
            });
        });

        function onInActivate(args) {
            var target = Accordion_content(args.inActiveIndex);
            $('#s' + target).show();
            //Syncfusion support community forum 121723
            if (target != 'x') {
                e = document.getElementById('D' + target);
                e.style.display = 'none';
            }
        }

        function onActivate(args) {
            if (args.activeIndex != undefined) {
                var target = Accordion_content(args.activeIndex);
                $('#s' + target).hide();
                //Syncfusion support community forum 121723
                if (target != 'x') {
                    e = document.getElementById('D' + target);
                    e.style.display = 'block';
                }
            }
        }

Thanks for the solution.
Bruce


Sellappandi Ramu [Syncfusion]
Replied On January 22, 2016 07:22 AM

Hi Bruce,

Thanks for the update.

We are happy to hear that your issues have been resolved.

Please get back to us if you have any queries. We are happy to assist you.

Regards,
Sellappandi R

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;