6 Answers, 1 is accepted
Could you please let me know whether the error appear if the ajax is disabled on the page and also if regular asp UpdatePanel is used instead of RadAjax?
Please find attached a sample application which demonstrates how you can ajaxify buttons of ModalPopupExtender.
Regards,
Maria Ilieva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Thank you for your response.
My code works fine when ajax is disabled for the page through the RadAjaxManager.
I've compiled and run the code that you attached. This code also has errors. The code doesn't generate the error that i'm currently experiencing, but it generates several javascript errors.
Best regards,
Magnus
Have you tested to use regular asp UpdatePanel with the ModalPopupExtender, as I suppose that the problem is ajax generic problem and not directly related to Telerik RadAjax?
Also please let me know what errors exactly you are receiving in the project I have sent you, as my local test are working correctly.
Greetings,
Maria Ilieva
the Telerik team
Hi Maria,
Using a regular asp UpdatePanel with the ModalPopupExtender still generates the same error:
System.ArgumentException: Invalid JSON primitive: . at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject() at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth) at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer) at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit) at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject(String input) at Telerik.Web.UI.RadWebControl.LoadPostData(String postDataKey, NameValueCollection postCollection) at Telerik.Web.UI.RadInputControl.LoadPostData(String postDataKey, NameValueCollection postCollection) at Telerik.Web.UI.RadWebControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
In regards to the errors I’m receiving in your example project; I receive the following error when clicking ‘lbEditDocInfo’:
Microsoft JScript runtime error: Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method.
The error occurs in:
var $removeHandler = Sys.UI.DomEvent.removeHandler = function Sys$UI$DomEvent$removeHandler(element, eventName, handler) {
/// <summary locid="M:J#Sys.UI.DomEvent.removeHandler" />
/// <param name="element"></param>
/// <param name="eventName" type="String"></param>
/// <param name="handler" type="Function"></param>
var e = Function._validateParams(arguments, [
{name: "element"},
{name: "eventName", type: String},
{name: "handler", type: Function}
]);
if (e) throw e;
Sys.UI.DomEvent._ensureDomNode(element);
var browserHandler = null;
if ((typeof(element._events) !== 'object') || (element._events == null)) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid);
var cache = element._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 (element.removeEventListener) {
element.removeEventListener(eventName, browserHandler, false);
}
else if (element.detachEvent) {
element.detachEvent('on' + eventName, browserHandler);
}
cache.splice(i, 1);
}
Best regards,
Magnus
Thanks
D
I havn't been able to resolve the issue, as I've yet to discover the root cause. But a possible workaround is to use the AJAX.NET scriptmanager and update panels instead, but that may or may not cause issues in other areas depending on the project.
Best regards,
Magnus