M
Mark Fox
Hello,
I am attempting to do something very simple. I have
a page MainPage.aspx and a popup window Popup.aspx. When
users click on the linkbutton in the popup window I am
looking to do some server side processing in Popup.aspx,
then have the popup window close, and have the
MainPage.aspx do a postback to the server. But I am
having trouble determining what client side javascript
Popup.aspx should render after it does its server side
processing. Are there any samples or articles tha
demonstrate how to do this? I keep getting "Object
Expected" in CloseChildWindow():
script.js
-------------------------------
var PopUp;
// Called from MainPage.aspx
function OpenPopup(id, mode, eid)
{
var url = "";
url += "Controls/PopUp.aspx?";
url += "FormName=" + document.forms[0].name;
url += "&id="+ id;
url += "&m=" + mode;
url += "&eid="+ eid;
var width = 250;
var height = 150;
var str = "";
str += "toolbars=no,";
str += "status=no,";
str += "resizable=0,";
str += "scrollbars=0,";
str += "width=" + width + ",";
str += "height=" + height + ",";
if ( window.screen ) {
var ah = screen.availHeight - 30;
var aw = screen.availWidth - 10;
var xc = ( aw - width ) / 2;
var yc = ( ah - height ) / 2;
str += ",left=" + xc + ",screenX=" + xc;
str += ",top=" + yc + ",screenY=" + yc;
}
PopUp = window.open( url, 'EmailList', str );
}
function CloseChildWindow(id, postBack)
{
debugger;
PopUp.close();
if (postBack)
__doPostBack(id,'');
}
The code I have in Popup.aspx is
<script language="JavaScript">
<!--
window.onload=window_onload();
function window_onload() {
window.opener.CloseChildWindow('a', true);
}
//-->
</script>
Any help would be appreciated! Thanks.
I am attempting to do something very simple. I have
a page MainPage.aspx and a popup window Popup.aspx. When
users click on the linkbutton in the popup window I am
looking to do some server side processing in Popup.aspx,
then have the popup window close, and have the
MainPage.aspx do a postback to the server. But I am
having trouble determining what client side javascript
Popup.aspx should render after it does its server side
processing. Are there any samples or articles tha
demonstrate how to do this? I keep getting "Object
Expected" in CloseChildWindow():
script.js
-------------------------------
var PopUp;
// Called from MainPage.aspx
function OpenPopup(id, mode, eid)
{
var url = "";
url += "Controls/PopUp.aspx?";
url += "FormName=" + document.forms[0].name;
url += "&id="+ id;
url += "&m=" + mode;
url += "&eid="+ eid;
var width = 250;
var height = 150;
var str = "";
str += "toolbars=no,";
str += "status=no,";
str += "resizable=0,";
str += "scrollbars=0,";
str += "width=" + width + ",";
str += "height=" + height + ",";
if ( window.screen ) {
var ah = screen.availHeight - 30;
var aw = screen.availWidth - 10;
var xc = ( aw - width ) / 2;
var yc = ( ah - height ) / 2;
str += ",left=" + xc + ",screenX=" + xc;
str += ",top=" + yc + ",screenY=" + yc;
}
PopUp = window.open( url, 'EmailList', str );
}
function CloseChildWindow(id, postBack)
{
debugger;
PopUp.close();
if (postBack)
__doPostBack(id,'');
}
The code I have in Popup.aspx is
<script language="JavaScript">
<!--
window.onload=window_onload();
function window_onload() {
window.opener.CloseChildWindow('a', true);
}
//-->
</script>
Any help would be appreciated! Thanks.