This one had me stumped for a while, turns out it was extremely simple and I just wanted to share. Here's the setup:
<
iframe id="Iframe1" frameborder="1" marginwidth="0" marginheight="0" width="745" scrolling="no" height="445" style="position:absolute;top:30px;left:5px;background-color:White;z-index:1000;visibility:hidden;" src="somepage.aspx"></iframe>
In the somepage.aspx I had a datalist with a SELECT command argument which updated an object on the server, then on the OnClientClick attribute I wanted to run a javascript function on the main page.
<
asp:Imagebutton ID="iThumb" runat="server" OnClientClick="SomeFunctionOnParentPage();" CommandName="SELECT" CommandArgument='0' ImageUrl='ImageThumb.aspx' />
I was trying which way to go up the heirarchy tree to find my function. document.parent, document.parent.frameset, etc. It turns out I was thinking about it all wrong, I needed to think relative to the IFrame. I just needed to put parent in front of the function name.
OnClientClick
="parent.SomeFunctionOnParentPage();"
I struggled with this one a bit, so I figured I'd post it to save someone else the same grief.
Scott Zischerk
Ann Arbor .Net Developers Member