Rank: Advanced Member Groups: Member
Joined: 6/14/2007 Posts: 83
|
Hi,
I have a user control with an EO dialog that loads an aspx file via ContentUrl. Upon a button event on the ContentUrl's aspx file, I would like to hide its container (the dialog object itself). I have the hardest time to get a hold on the object. I tried the Parent.FindControl, but it returns no value.
Is there any way to do that?
Thanks
Steve Komaromi
Computer Systems Manager, Lead Developer Business Risk Partners, Inc. Tel: 1-(860)-903-0039
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
There isn't any kind of server side relationship between the host page and the content page. These are just two different pages with one loading the other through an iframe. They go to the server as separate independent requests. So using server side code such as FindControl is out of question.
This means you only way to do this is through client side JavaScript. On the client side, the JavaScript code inside the content page can either have full access or very limited access to the parent page. If they are frame the same domain, then the content page can have full access to the host page. In that case you can simply call a JavaScript function inside the host page's when the button in the content page is clicked. For example, you can write a JavaScript function closeMyDialog in your host page, then in your content page you can simply call window.parent.closeMyDialog().
If the two pages are from different domains, then things will be much more difficult due to special security rules for cross frame scripting. The kind of direct calling described above won't work. You can search online about cross frame scripting to find more details about this since this very much falls into general web page JavaScript programming.
Thanks!
|
Rank: Advanced Member Groups: Member
Joined: 6/14/2007 Posts: 83
|
Thank you
Thanks
Steve Komaromi
Computer Systems Manager, Lead Developer Business Risk Partners, Inc. Tel: 1-(860)-903-0039
|