問題
使用 showModalDialog頁面傳值
解決方法
main page
var returnObj = null;
var _url = '<%=ResolveUrl("~/TEST.aspx")%>';
returnObj = window.showModalDialog(_url, {
dialogWidth: '450px',
dialogHeight: '450px',
dialogTop: '100px',
dialogLeft: '100px',
center: 0,
resizable: 0,
scroll: 1,
status: 0
});
if (returnObj) codeValue = returnObj.codeValue;
if (codeValue == null) return;
if (returnObj.cancel)//取消
return true;
sub page
var ReturnObj = new Object(); ReturnObj.codeValue = 'Cancel'; ReturnObj.cancel = true; window.returnValue = ReturnObj; window.close();
沒有留言:
張貼留言