Solved

Javascript Refresh Parent Page from Popup

Posted on 2016-11-17
3
95 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
Suggested Courses

621 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