I use a RadWindow to add a new row in a RadGrid. The content of this 'add new record' window is nothing much.. a RadComboBoxes and a few RadNumericTextBoxes and two buttons: Add and Close.
When the windows closes (add button is clicked, close button is clicked or I close it with the upper-right X), an error appears:
Microsoft JScript runtime error: Can't execute code from a freed script
This is the javascript code used to show 'add new record' window from the main window where the grid is:
To rebind the grid, after the 'add new record' windows closes, I use an ajaxRequest (RefreshGrid function).
This is where I think the problem lies: If I remove the
I've read a few posts about this error, but I can't get it to work.
Please help! Thank you!
When the windows closes (add button is clicked, close button is clicked or I close it with the upper-right X), an error appears:
Microsoft JScript runtime error: Can't execute code from a freed script
This is the javascript code used to show 'add new record' window from the main window where the grid is:
function DisplayAddWindow() { var parentPage = GetRadWindow().BrowserWindow; var parentRadWindowManager = parentPage.GetRadWindowManager(); var oWnd2 = parentRadWindowManager.open("AddNewRecordWindow.aspx", "rwAddWindow"); window.setTimeout(function () { oWnd2.set_title("Add new record"); oWnd2.setActive(true); oWnd2.set_modal(true); oWnd2.setSize(370, 240); oWnd2.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close); oWnd2.set_visibleStatusbar(false); oWnd2.set_showContentDuringLoad(false); oWnd2.center(); oWnd2.add_close(RefreshGrid); }, 0); return false;}function RefreshGrid(oWnd, eventArgs) { $find("<%= RadAjaxManager1.ClientID%>").ajaxRequest("RefreshGrid");}To rebind the grid, after the 'add new record' windows closes, I use an ajaxRequest (RefreshGrid function).
This is where I think the problem lies: If I remove the
oWnd2.add_close(RefreshGrid); statement the problem dissapears but the ajaxRequest doesn't fire (the grid doesn't refresh).I've read a few posts about this error, but I can't get it to work.
Please help! Thank you!