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

ScriptResource.axd error when navigating away from page

6 Answers 160 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 20 Jan 2011, 12:18 PM
I have a couple of pages on my site that dynamically add RadPanelItems to a RadPanelBar and apply header and content templates to them. I have recently noticed that when I navigate away from these pages when the site is debugging, I get a ScriptResource.asxd?d=LotsOfNumbersAnNdLetters..... error that reads like so...

Microsoft JScript runtime error: Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method.

I can only assume this has something to do with the Templates that get applied, but cant work out whats wrong as the pages work exactly as they're meant to and don't produce any server or client side errors until this one. Again, this error ONLY occurs when navigating away from the page, not on postback.

The templates do have event handlers added to controls that are built in the templates and think it might have something to do with these, but when I comment these handlers and methods out, I still get the same error...

It's very puzzling and I have to get it fixed but have run out of ideas.

6 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 25 Jan 2011, 09:36 AM
Hello Karl,

Could you, please, try to isolate the problem in a single page (as small amount of code as possible) that will continue to reproduce it.
There is a big chance you will be able to resolve the problem on your own during the process, but even if you are not able to you can post the page and we will try to help you out.


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Karl
Top achievements
Rank 1
answered on 25 Jan 2011, 01:04 PM
Hi Nikolay,

Bad news I'm afraid.

I've taken out huge chunks of code and put all the relevant code required to build the page so it functions as I need into one aspx page with a code behind and I'm still getting the same issue. The page loads exactly as I want it to, but when I navigate away from it, even to a completely different site, such as Google, it generates the ScriptResource error.

How do I go about sending the files to you so someone there can see either what I'm doing wrong, or where the issue lies? I cant attach them here as I'm only allowed to attach gif, jpg, jpeg and png files.

Thanks
0
Nikolay Tsenkov
Telerik team
answered on 28 Jan 2011, 10:38 AM
Hello Karl,

If upload is required, then you need to open a support ticket (only there you can upload an attachment to your post).


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Karl
Top achievements
Rank 1
answered on 02 Feb 2011, 06:15 PM
This was an issue caused by the 2010.3.1215 dll which was fixed when I referenced the 2010.3.1317 dll instead.
0
Chandan Dey
Top achievements
Rank 1
answered on 23 May 2011, 11:19 AM
Hi,
I am using Telerik.Web.UI.dll (Version - 2010.3.1317.40) and working with RadSplitter, RadSplitBar.
When I resize the RadSplitBar sometime (not everytime) an error occued 
Error : Microsoft JScript runtime error: Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method.

In file ScriptResource.axd & method :
$type._removeHandler = function DomEvent$_removeHandler(elements, eventName, handler) {
    Sys.query(elements).each(function() {
        var nodeType = this.nodeType;
        if (nodeType === 3 || nodeType === 2 || nodeType === 8) return;
        Sys.UI.DomEvent._ensureDomNode(this);
        var browserHandler = null;
        if ((typeof(this._events) !== 'object') || !this._events) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
        var cache = this._events[eventName];
        if (!(cache instanceof Array)) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
        for (var i = 0, l = cache.length; i < l; i++) {
            if (cache[i].handler === handler) {
                browserHandler = cache[i].browserHandler;
                break;
            }
        }
        if (typeof(browserHandler) !== 'function') throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
        if (this.removeEventListener) {
            this.removeEventListener(eventName, browserHandler, false);
        }
        else if (this.detachEvent) {
            this.detachEvent('on' + eventName, browserHandler);
        }
        cache.splice(i, 1);
    });
}

Please help me asap.

Thanks,
Chandan
0
Dobromir
Telerik team
answered on 26 May 2011, 08:04 AM
Hi Chandan,

We are aware of an bug in RadSplitter which was causing such error in previous versions of the control which is already fixed. Could you try to upgrade to the latest version of RadControls for ASP.NET AJAX (currently Q1 2011 SP2) and see if the problem still occurs?

If upgrading does not fix the issue, could you please provide a sample project reproducing the problem so we can investigate it further?

Regards,
Dobromir
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
PanelBar
Asked by
Karl
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Karl
Top achievements
Rank 1
Chandan Dey
Top achievements
Rank 1
Dobromir
Telerik team
Share this question
or