I am trying to close a modal dialog window and redirect the parent to another page using the following code:
function
fnCloseWindow(){
self.close();
var oParentWindow = window.dialogArguments;
oParentWindow.opener.location.href = 'default.aspx';
returntrue;
}
This function I am calling in the click event of a button in the code behind as below
string
strScript = @"<script language='javascript' type='text/javascript'>";
strScript += "fnCloseWindow();";
strScript += @"</script>";
ClientScript.RegisterClientScriptBlock(typeof(Page), "onClick", strScript);
Everything works fine in IE7. In IE6 the modal dialog closes but does not redirect to default.aspx page.
Any help is appreciated.