Hi,
Did anyone run into the following javascript error while using the CalendarExtender?
Uncaught Sys.ArgumentException: Sys.ArgumentException: Value must not be null for Controls and Behaviors. Parameter name: element
The error appears in the following javascript function (chrome browser):
$create = $type.create = function Component$create(type, properties, events, references, element) { /// <summary locid="M:J#Sys.Component.create">Instantiates a component of the specified type, attaches it to the specified element if it's a Control or Behavior, sets the properties as described by the specified JSON object, then calls initialize.</summary> /// <param name="type" type="Type">The type of the component to create.</param> /// <param name="properties" optional="true" mayBeNull="true">A JSON object that describes the properties and their values.</param> /// <param name="events" optional="true" mayBeNull="true">A JSON object that describes the events and their handlers.</param> /// <param name="references" optional="true" mayBeNull="true">A JSON object that describes the properties that are references to other components. The contents of this object consists of name/id pairs. If in a two-pass creation, the setting of these properties will be delayed until the second pass.</param> /// <param name="element" domElement="true" optional="true" mayBeNull="true">The DOM element the component must be attached to.</param> /// <returns type="Object">The component instance.</returns> var e = Function._validateParams(arguments, [ {name: "type", type: Type}, {name: "properties", mayBeNull: true, optional: true}, {name: "events", mayBeNull: true, optional: true}, {name: "references", mayBeNull: true, optional: true}, {name: "element", mayBeNull: true, domElement: true, optional: true} ]); if (e) throw e; if (type.inheritsFrom(Sys.UI.Behavior) || type.inheritsFrom(Sys.UI.Control)) { if (!element) throw Error.argument('element', Sys.Res.createNoDom); } else if (element) throw Error.argument('element', Sys.Res.createComponentOnDom); var component = (element ? new type(element): new type()); callIf(component, "beginUpdate"); if (properties) { Sys.Component._setProperties(component, properties); } if (events) { for (var name in events) { if (!(component["add_" + name] instanceof Function)) throw new Error.invalidOperation(String.format(Sys.Res.undefinedEvent, name)); if (!(events[name] instanceof Function)) throw new Error.invalidOperation(Sys.Res.eventHandlerNotFunction); component["add_" + name](events[name]); } } Sys.Component._register(component, references); return component; }
I am building a dynamic form and I add the extender and the textbox control from codebehind.
Unfortunatelly I sometimes get the above javascript error. I have no idea why in some cases it appears and others it doesn't.
I would really appreciate your help with that.
Thanks