Click here to Skip to main content
15,907,395 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In one of mine web application, i have one parent page, there is one button on parent page, on click this button i am calling javascript function for show Modal Dialog.
XML
<script type="text/javascript">
    function getUrlVars() {
        var vars = {};
        var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
            vars[key] = value;
        });
        return vars;
    }

    function OpenDialog() {
        var _payrollId = getUrlVars()["payrollId"];
        if (_payrollId != "") {
            Options = "dialogWidth:900px;dialogHeight:500px;help:no;scroll:yes;status:no:";
            OpenReportJS = window.showModalDialog("/PickList/PayrollHead.aspx?payrollId=" + _payrollId, "_blank", Options);
        }
    }

</script>


-------------------------
Now in the child page i have one button and when i click this button want to close the show modal dialog and want to refresh the parent page.
How can i do this, please give me some hints...
Posted

1 solution

Parent window refresh javascript code is
JavaScript
window.opener.location.href='Parent.aspx';

You just call that line after close modal dialog. Parent.aspx is a example of page you just replace it with your parent page.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900