Saturday, March 10, 2012

user control event hoses the works

I noticed triggering the event causes a javascript error to appear in the browser:
line: 10704
char: 17
error: object required

Not sure how to diagnose this, never got up to speed with any javascript debuggers ;)

Thanks!
finally dawned on me that Firefox would be a better testbed ;)

When I run it in FF I can open the console window and it provides a link to this function:

function destroyTree(element, markupContext) {
if (element.nodeType == 1) { << error is here
if (element.control) {
markupContext.removeObject(element.control);
element.control.dispose();
}

var children = element.children;
for (var i = children.length - 1; i >= 0; i--) {
var node = children[i];
destroyTree(node, markupContext);
element.removeChild(node);
}
}
}

I have no idea what this does and why there is not object, presumably element is null.

hello.well, i remeber seing a bug in the way firefox treats the element type, though i think this is a different bug. however, you can try searching these forums for it...who knows, maybe it's the same?

another option is to build a small page that reproduces the problem and that we can run, this will make it easier to diagnose the problem.


Hi Luis.

The error occurs in IE 6 as well, just used Firefox because it has better javascript console and Venkman debugger. You're right, I should put together a simple case of this. I could take the code in user controls and place it directly into web pages alleviating the need for event propagation. Sometimes good engineering gives way to expediency, eh?

Thank.

No comments:

Post a Comment