Hello All,
I wrote the following javascript code to open a pop up window in ff and ie.
function schedulerOpener(schedulerWindow) {
var browser = navigator.appName;
if (browser=="Microsoft Internet Explorer")
window.showModalDialog(schedulerWindow, 'window.self', 'center:yes;resizable:yes;status:no;dialogWidth:350px;dialogHeight:480px');
else
window.open(schedulerWindow, 'Schedule Event', 'width=350, height=480');
}
The window closes easily in ff, but when i try to close it on a button click in i.e, it opens another window. Can anyone help me. Also I want to reload the parent window before closing, this I am able to do in ff but not i.e.
(this javascript is in the code behind file of aspx page).
closeWindow function is called on a button click.
private void closeWindow()
{
string script = "<script type='text/javascript'>";
script += "window.close();";
script += "if (window.showModalDialog){";
script += "parent.location = parent.location;";
script += "window.returnValue = null;";
script += "window.close();}";
script += "else if ((window.opener != null) && (!window.opener.closed)){";
script += "window.opener.document.getElementById(ctr[1]).value = null;}";
script += "window.close();}";
script += "</script>";
Page.ClientScript.RegisterStartupScript(this.GetType(), "mykey1", script);
}
I wrote the following javascript code to open a pop up window in ff and ie.
function schedulerOpener(schedulerWindow) {
var browser = navigator.appName;
if (browser=="Microsoft Internet Explorer")
window.showModalDialog(schedulerWindow, 'window.self', 'center:yes;resizable:yes;status:no;dialogWidth:350px;dialogHeight:480px');
else
window.open(schedulerWindow, 'Schedule Event', 'width=350, height=480');
}
The window closes easily in ff, but when i try to close it on a button click in i.e, it opens another window. Can anyone help me. Also I want to reload the parent window before closing, this I am able to do in ff but not i.e.
(this javascript is in the code behind file of aspx page).
closeWindow function is called on a button click.
private void closeWindow()
{
string script = "<script type='text/javascript'>";
script += "window.close();";
script += "if (window.showModalDialog){";
script += "parent.location = parent.location;";
script += "window.returnValue = null;";
script += "window.close();}";
script += "else if ((window.opener != null) && (!window.opener.closed)){";
script += "window.opener.document.getElementById(ctr[1]).value = null;}";
script += "window.close();}";
script += "</script>";
Page.ClientScript.RegisterStartupScript(this.GetType(), "mykey1", script);
}