Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Javascript Refresh Parent Page from Popup

Posted on 2016-11-17
3
Medium Priority
?
125 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 2000 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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…

688 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