Solved

Javascript Refresh Parent Page from Popup

Posted on 2016-11-17
3
25 Views
Last Modified: 2016-11-29
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now