Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 145
  • Last Modified:

Javascript Refresh Parent Page from Popup

I have a .net web page that opens a popup page using this
From....RadGrid ItemCreated event
 DirectCast(dataItem.FindControl("LinkEditJsonMedicalDtl"), HyperLink).Attributes("onclick") = "return window.radopen('EditMedical.aspx?IndividualID=" & IndividualID & "&OriginID=" & OriginID & "&ID=" & medexID & "&IsPopup=1" & "','ViewContact');"

Open in new window


The popup page uses a MasterPage
On close or exit of the popup I would like to refresh the Parent Page
0
lrbrister
Asked:
lrbrister
1 Solution
 
Moussa MokhtariEnterpreneurCommented:
You can do it easily with javascript see this example  

<!DOCTYPE html>
<html>
    <style>
        body{
background:red;
}
#popup{
background:yellow;
width:250px;
height:150px;
margin:20px;
display: none;
}
    </style>
    <body>
        <p>
            This is the parent page My color is RED
        </p>
        <button onclick="openpopup()">
            Open popup
        </button>
        <div id="popup">
            <button onclick="exitpopup()">
                X
            </button>
            <p>
                This is me Popup my color is yellow
            </p>
        </div>
        <script>
            function exitpopup() {
    location.reload();
}
function openpopup() {
   document.getElementById('popup').style.display='block';
}
        </script>
    </body>
</html>

Open in new window

0
 
leakim971PluritechnicianCommented:
use the OnClientClose event :

<telerik:RadWindow OnClientClose="refreshParent" runat="server" />

add this javascript in your page :
var refreshParent = function(sender,args)   {
     window.location.href = window.location.href;
}

Open in new window

 

More info and examples here : http://docs.telerik.com/devtools/aspnet-ajax/controls/window/client-side-programming/events/onclientclose
0
 
lrbristerAuthor Commented:
Sorry for the VERY late get back
1

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now