Solved

Javascript Refresh Parent Page from Popup

Posted on 2016-11-17
3
63 Views
Last Modified: 2017-01-24
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
Comment
Question by:lrbrister
3 Comments
 
LVL 9

Expert Comment

by:Moussa Mokhtari
ID: 41892154
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
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 41892425
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
 

Author Closing Comment

by:lrbrister
ID: 41905912
Sorry for the VERY late get back
1

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question