string strMessage = "Do you want to add items now?";
JS =
" Sys.Application.add_init(CRInit);";
JS +=
" function CRInit(){ Sys.Application.add_load(SRRunOnce);}";
JS +=
" function SRRunOnce(){ showConfirmation(); Sys.Application.remove_load(SRRunOnce);}";
JS +=
" function GetRadWindow1(){";
JS +=
" var oWindow = null;";
JS +=
" if (window.radWindow) oWindow = window.radWindow;";
JS +=
" else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;";
JS +=
" return oWindow;";
JS +=
"}";
JS +=
" function showConfirmation(){";
JS +=
" function CallBackFn(arg){";
JS +=
" var oWindow = GetRadWindow1();";
JS +=
" if (arg == 'Yes'){";
JS +=
" window.location = 'ComponentReworkPackSlipItemDetail.aspx?R=Y&A=A&pid=" + oPackingSlip.PackingSlipReworkId.ToString() + "';";
JS +=
" }";
JS +=
" else {";
JS +=
" oWindow.Close();";
JS +=
" oWindow.BrowserWindow.refreshGridAndLocate(" + oPackingSlip.PackingSlipReworkId.ToString() + ");";
JS +=
"}";
JS +=
"}";
JS +=
" radconfirm('" + strMessage + "', CallBackFn, 530, 100, null, 'Confirm Add Item');";
JS +=
"}";
ScriptManager.RegisterStartupScript(Page, this.Page.GetType(), key, JS, true);
}
After user click a button to update to database, the page will prompt user to determine whether add line item now. The above works fine.
However, when updating to 2009Q2, the code is no longer work with JS error message of "object doesn't support this property or method".
Please advice how to resolve this.