I have developed a web app in Visual Studio 2008, and when I run I consistently get the following error:
Microsoft JScript runtime error: Unable to get value of the property 'toLowerCase': object is null or undefined
and in the debugger it shows me the source file is "ScriptResource.adx?****[dynamic][Read Only]". The error is occurring in the DomEvent() function:
$type = Sys.UI.DomEvent = function DomEvent(eventObject) { var e = Function._validateParams(arguments, [ {name: "eventObject"} ]); if (e) throw e; var ev = eventObject; var etype = this.type = ev.type.toLowerCase(); <== ERROR this.rawevent = ev; altkey = ev.altKey;
and DomEvent() is called from DomEvent$addHandler() in the same file:
$addHandler = $type.addHandler = function DomEvent$addHandler(elements, eventName, handler, autoRemove) { var e = Function._validateParams(arguments, [ {name: "elements"}, {name: "eventName", type: String}, {name: "handler", type: Function}, {name: "autoRemove", type: Boolean, mayBeNull: true, optional: true} ]); if (e) throw e; if (eventName === "error") throw Error.invalidOperation(Sys.Res.addHandlerCantBeUsedForError); Sys.query(elements).each(function() { var nodeType = this.nodeType; if (nodeType === 3 || nodeType === 2 || nodeType === 8) return; Sys.UI.DomEvent._ensureDomNode(this); if (!this._events) { this._events = {}; } var eventCache = this._events[eventName]; if (!eventCache) { this._events[eventName] = eventCache = []; } var element = this, browserHandler; if (this.addEventListener) { browserHandler = function(e) { return handler.call(element, new Sys.UI.DomEvent(e)); } this.addEventListener(eventName, browserHandler, false); } else if (this.attachEvent) { browserHandler = function() { var ex, ev = {}; try {ev = Sys.UI.DomElement._getWindow(element).event} catch(ex) {} return handler.call(element, new Sys.UI.DomEvent(ev)); <== HERE } this.attachevent('on' + eventname, browserhandler); }
Has anyone seen this type of behavior?