Welcome Guest Search | Active Topics | Sign In | Register

Dialog with ContentUrl Options
hunpirate
Posted: Tuesday, December 1, 2020 8:04:42 PM
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
eo_support
Posted: Wednesday, December 2, 2020 4:22:53 PM
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!
hunpirate
Posted: Thursday, December 3, 2020 8:39:21 AM
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


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.