Reputation: 4406
see above...
Upvotes: 1
Views: 2677
Reputation: 456
string windowArgs = "toolbar=no,menubar=no,location=no,width=620,height=500,scrollbars=yes,resizable=yes,modal=yes"; string newWindowUrl = "MarketShotPreview.aspx"; string javaScript = "\n" + "\n" + "\n"; ClientScript.RegisterStartupScript(typeof(System.Web.UI.Page), "Popup", javaScript);
Upvotes: 0
Reputation: 32391
I would do something like so in button click of the popup
ClientScript.RegisterStartupScript(typeof(string), "auto_refreshparent", @" window.opener.location.reload(); ", true);
ClientScript.RegisterStartupScript(typeof(Page), "ThatsAllFolks", "window.close();", true);
Upvotes: 2
Reputation: 19368
You should be able to call functions in window.parent.
<script type="text/javascript">
function closeThisPopupWindow()
{
if (window.parent && window.parent.callBack)
window.parent.callBack();
window.close();
}
</script>
Obviously you would need to attach the closeThisPopupWindow function to your button.
Upvotes: 3
Reputation: 37567
Try something like this:
parent.document.getElementById('btnSubmit').click();; // submit the parent form
self.close(); // close the current window
Upvotes: 2