Trying to refresh-reload child IFrame content from parent page.

4 posts, 0 answers
  1. John
    John avatar
    10 posts
    Member since:
    Aug 2013

    Posted 13 Apr 2014 Link to this post

    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
      <telerik:RadWindow ID="ServerAdd" runat="server" Behavior="Close" Behaviors="Close" Modal="True" NavigateUrl="ServerAssignJob.aspx" style="display:none;" VisibleStatusbar="False" DestroyOnClose="True" OnClientClose="windowOnClientClose" MinHeight="600px" MinWidth="850px">
    <script type="text/javascript">
     function windowOnClientClose(sender, args) {  
      for (var i = 0; i < self.frames.length; i++) {
       var myFrame = self.frames[i].document.getElementById("RadPageViewServers");   

    if (myFrame != undefined || myFrame != null) {
        //myFrame.contentDocument.location.href = "ServerAssign.aspx";    
    //myFrame does get the reference to the correct IFrame I can see the innerhtml and it looks correct.
        myFrame.src = myFrame.src;
        //JavaScript runtime error: Unable to get property 'location' of undefined or null reference
       return false;
      }      }

    CHILD IFRAME CONTENT URL = "ServerAssign.aspx"
    It calls the radopen on parent page.

    <script type="text/javascript" >
     function clickHandler(sender, eventArgs) {
     //Checks which item is clicked
     if (eventArgs.get_item().get_text() == "Add New") {
      var topWindow =;
      var tab = topWindow.document.getElementById('RadWindowManager1');
      topWindow.radopen("ServerAssignJob.aspx", "ServerAdd");    
      return false;
     }    }</script>
  2. John
    John avatar
    10 posts
    Member since:
    Aug 2013

    Posted 13 Apr 2014 in reply to John Link to this post

    Ok after looking at my innerHtml I see that I was grabbing a reference to the RadPage Div and not the IFrame element it created.
    So after adding this code it works.
    if (myFrame != undefined || myFrame != null) {
     varRealFrame = myFrame.firstElementChild;                            
    Thanks John
  3. Jamie
    Jamie avatar
    1 posts
    Member since:
    Apr 2017

    Posted 25 Apr 2017 Link to this post

    Hi John.... taking as long shot that you still visit this page and will see this. I have a question about your problem/solution here to see if it applies to what I am attempting to do. lmk if you see this. Thank you.
  4. John
    John avatar
    10 posts
    Member since:
    Aug 2013

    Posted 26 Apr 2017 in reply to Jamie Link to this post

    I guess a long shots is better than no shot.

    What's on your mind?

Back to Top