I have an aspx page with some controls. One of which is an iframe
, whose source changes (depending on the selection in a listbox
). So, if a user selects an item in the listbox
(ie: Claims.aspx
), the iframe
s source changes to Claims.aspx
.
I have a button on my 'child' pages (ie: Claims.aspx
). I'd really like to have that button execute either:
- Javascript from the 'parent' page
- A VB function in the code-behind of the 'parent' page
Is the开发者_JAVA百科re any way to do this?
If your parent page and your content page are both on the same domain (which I'm presuming they are) you can simply do:
parent.myFunction();
from your content page to access myFunction()
in your parent page.
Similar to Town's answer, you can also use top
as in
top.myFunction();
to call the parent's myFunction
function from the Iframe.
精彩评论