Accessing Ajax modal pop control from a page in iframe
-
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
-
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
-
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[^]
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
-
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
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]
-
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]
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
-
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]
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
-
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
-
did you try the $find statement to locate the modalPopupControl? $find("ModalPopupExtender1").show()
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
-
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