We have windows with radgrids and other controls.
If the user clicks the X before the page has finished loading we get this error: (in Chrome 30)
Uncaught TypeError: Cannot read property `1` of null
This is the code:
var oWnd = window.$find('Modal' + (window.myModalWindows.length + 1));
function OnClientBeforeClose(sender, eventArgs) {
var pageName = oWnd.get_contentFrame().contentWindow.location.pathname.match(/.*\/([^\/\.]+)/i)[1]; <-- Error line
if (oWnd.get_contentFrame().contentWindow[pageName + "_onunload"])
oWnd.get_contentFrame().contentWindow[pageName + "_onunload"]();
oWnd.get_contentFrame().contentWindow.location.replace('Blank.aspx');
}
If the user clicks the X before the page has finished loading we get this error: (in Chrome 30)
Uncaught TypeError: Cannot read property `1` of null
This is the code:
var oWnd = window.$find('Modal' + (window.myModalWindows.length + 1));
function OnClientBeforeClose(sender, eventArgs) {
var pageName = oWnd.get_contentFrame().contentWindow.location.pathname.match(/.*\/([^\/\.]+)/i)[1]; <-- Error line
if (oWnd.get_contentFrame().contentWindow[pageName + "_onunload"])
oWnd.get_contentFrame().contentWindow[pageName + "_onunload"]();
oWnd.get_contentFrame().contentWindow.location.replace('Blank.aspx');
}