Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Accessing Ajax modal pop control from a page in iframe

Accessing Ajax modal pop control from a page in iframe

Scheduled Pinned Locked Moved ASP.NET
javascript
9 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nainakarri
    wrote on last edited by
    #1

    Hi I have an a.aspx page and inside that page, i have ajax modal pop up extender. This will open an iframe which has b.aspx page. When i click on a button in b.aspx page , i should be able to hide the modal pop up extender in a.aspx page. I tried using the below code to access the modal pop up extender id from b.aspx using javascript but didnt work.

    if(window.parent.document.getElementById("AlertNotesExt"))
    {
    var iframe = parent.document.getElementById("AlertNotesExt");

               iframe.hide();
        }
    }
    

    Thanks in advance Naina

    Naina

    J 1 Reply Last reply
    0
    • N nainakarri

      Hi I have an a.aspx page and inside that page, i have ajax modal pop up extender. This will open an iframe which has b.aspx page. When i click on a button in b.aspx page , i should be able to hide the modal pop up extender in a.aspx page. I tried using the below code to access the modal pop up extender id from b.aspx using javascript but didnt work.

      if(window.parent.document.getElementById("AlertNotesExt"))
      {
      var iframe = parent.document.getElementById("AlertNotesExt");

                 iframe.hide();
          }
      }
      

      Thanks in advance Naina

      Naina

      J Offline
      J Offline
      jkirkerx
      wrote on last edited by
      #2

      How to Show / Hide a ModalPopupExtender using Javascript http://weblogs.asp.net/ashicmahtab/archive/2009/05/06/how-to-show-hide-a-modalpopupextender-using-javascript.aspx[^]

      N 1 Reply Last reply
      0
      • J jkirkerx

        How to Show / Hide a ModalPopupExtender using Javascript http://weblogs.asp.net/ashicmahtab/archive/2009/05/06/how-to-show-hide-a-modalpopupextender-using-javascript.aspx[^]

        N Offline
        N Offline
        nainakarri
        wrote on last edited by
        #3

        Hi, Thanks for the reply. I can access if i am trying to access from same aspx page. Problem is when i am trying to access from a different aspx page , inside iframe. Regards Naina

        Naina

        J 1 Reply Last reply
        0
        • N nainakarri

          Hi, Thanks for the reply. I can access if i am trying to access from same aspx page. Problem is when i am trying to access from a different aspx page , inside iframe. Regards Naina

          Naina

          J Offline
          J Offline
          jkirkerx
          wrote on last edited by
          #4

          For that, I think you have to setup a comm link, sort of like going from browser window to Browser window with Javascript if the domain name is the same [iframe-to-iframe-communication] If the domain name is not the same, modern browsers will prevent cross domain scripting, bu there are some work arounds. [how-to-communicate-between-iframe-and-the-parent-site]

          N 2 Replies Last reply
          0
          • J jkirkerx

            For that, I think you have to setup a comm link, sort of like going from browser window to Browser window with Javascript if the domain name is the same [iframe-to-iframe-communication] If the domain name is not the same, modern browsers will prevent cross domain scripting, bu there are some work arounds. [how-to-communicate-between-iframe-and-the-parent-site]

            N Offline
            N Offline
            nainakarri
            wrote on last edited by
            #5

            Hi, Sorry for my late reply. I am able to get all other control id's in the iframe, except the ajax controls. That's the main problem here. Regards Naina

            Naina

            J 1 Reply Last reply
            0
            • J jkirkerx

              For that, I think you have to setup a comm link, sort of like going from browser window to Browser window with Javascript if the domain name is the same [iframe-to-iframe-communication] If the domain name is not the same, modern browsers will prevent cross domain scripting, bu there are some work arounds. [how-to-communicate-between-iframe-and-the-parent-site]

              N Offline
              N Offline
              nainakarri
              wrote on last edited by
              #6

              Here, i am using the following code in the iframe aspx page

              if(window.parent.document.getElementById("AlertNotesExt"))
              {
              var iframe = parent.document.getElementById("AlertNotesExt");

                         iframe.hide();
                  }
              }
              

              AlertNotesExt is the id of ajax modal pop up extender. But in that place, if i give any other asp.net cpntrol id like button etc., i am getting the id. Regards Naina

              Naina

              1 Reply Last reply
              0
              • N nainakarri

                Hi, Sorry for my late reply. I am able to get all other control id's in the iframe, except the ajax controls. That's the main problem here. Regards Naina

                Naina

                J Offline
                J Offline
                jkirkerx
                wrote on last edited by
                #7

                did you try the $find statement to locate the modalPopupControl? $find("ModalPopupExtender1").show()

                N 1 Reply Last reply
                0
                • J jkirkerx

                  did you try the $find statement to locate the modalPopupControl? $find("ModalPopupExtender1").show()

                  N Offline
                  N Offline
                  nainakarri
                  wrote on last edited by
                  #8

                  Finally i got a workaround to solve the issue. I used $Find("ModalPopupExtender1") inside the page in iframe but returned null. So i called a javacscript function located in the parent page from the child page. In the javascript function, i closed the modal pop up window. Thanks for your time and help. Regards Naina

                  Naina

                  J 1 Reply Last reply
                  0
                  • N nainakarri

                    Finally i got a workaround to solve the issue. I used $Find("ModalPopupExtender1") inside the page in iframe but returned null. So i called a javacscript function located in the parent page from the child page. In the javascript function, i closed the modal pop up window. Thanks for your time and help. Regards Naina

                    Naina

                    J Offline
                    J Offline
                    jkirkerx
                    wrote on last edited by
                    #9

                    Your Welcome. I've use the find to close the popup, but not in an iframe, but it's in the right direction.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups