January 7, 2013

Access parent page’s control on iframe page

When we are popping a popup using iframe and doing some changes reflection should come on parent page.
Write a JavaScript on iframe page that will access parent page control.

<
script type="text/javascript">

   function SetParentValue(val)

     {

         window.parent.document.getElementById('<Put here parent page control ID>').value = val;

     }

</script>


Now you can call this function any where like button click event.


 

That’s It.
Enjoy Learning.

No comments:

Post a Comment