Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Commented Issue: Microsoft JScript runtime error: Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method [27203]

$
0
0
I have a tab container with 3 tab panels.Inside the first tab panel i have cascading drop down extenders and dynamic populate extender. I have placed a button inside this tab panel which when clicked will trigger a button click event (button is placed in the second tab panel) to change the view to the second tab panel.

The second tab panel contains an update panel and inside this, i have few asp.net buttons, file upload control and a mutually exclusive checkbox extender with target control id set to a radiobutton. The radio button and mutually exclusive checkbox entender is inside the ItemTemplate of repeater control.

I have set postback trigger for the button using which i upload the file selected in the file upload control.

When i load the page, by default the first tab panel is displayed to the user. Without doing anything, if i click on the close button of the browser, i get this JScript runtime error.

I am using Visual Studio 2008, .net framework 3.5 and AjaxControlToolkit for .net framework 3.5. (November 2011 release)

The eventname in question is "click". The method where the error is caught is as below:

$removeHandler = $type.removeHandler = function DomEvent$removeHandler(elements, eventName, handler) {
/// <summary locid="M:J#Sys.UI.DomEvent.removeHandler">A cross-browser way to remove a DOM event handler from an element.</summary>
/// <param name="elements">The element or text node, or array of elements or text nodes, that exposes the event. You may also pass a DOM selector or array of DOM selectors.</param>
/// <param name="eventName" type="String">The name of the event. Do not include the 'on' prefix, for example, 'click' instead of 'onclick'.</param>
/// <param name="handler" type="Function">The event handler to remove.</param>
var e = Function._validateParams(arguments, [
{name: "elements"},
{name: "eventName", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.UI.DomEvent._removeHandler(elements, eventName, handler);
}
$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);
});
}

Note: I have not added any event handlers explicitly for the ajax controls.

Appreciate if you can please suggest a fix for this.

Comments: Any solution?

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>