Welcome Guest Search | Active Topics | Sign In | Register

Close a Dialog from code. Options
lochiano
Posted: Wednesday, May 7, 2014 7:01:44 PM
Rank: Newbie
Groups: Member

Joined: 4/26/2014
Posts: 2
We are using your dialog to host a login page (e.g. using contentURL). All of our pages are written in C#.

The hosted login page is an aspx page that contains all of the display and behavior logic.

My question is how can we close the dialog when the login is sucessful. Since the login button belongs to the hosted aspx page it is not on the page that initially displayed the dialog. It does not seem that the original dialog control id is visible to the hosted aspx page. Perhaps there is a way to save the original <eo:Dialog> tag into a session variable to provide visibility?
eo_support
Posted: Thursday, May 8, 2014 2:14:48 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

You do not need to do anything to close the dialog at all. The dialog is automatically closed when the page posts back.

Thanks!
lochiano
Posted: Thursday, May 8, 2014 1:22:46 PM
Rank: Newbie
Groups: Member

Joined: 4/26/2014
Posts: 2
Perhaps some further explaination is needed.

Original Page (contains dialog) --> dialog contentUrl to embedded ASPX Login Page with controls --> user enters name/password and presses Login in the embedded ASPX page. At this point need to close the dialog AND return control to the original page --> Original Page has not done a post back since all of the logic is in the embedded ASPX page.

So how do we either A) close the dialog from the embedded page or
B) tell the Original Page that the dialog is completed so it can post back or close the dialog.

eo_support
Posted: Thursday, May 8, 2014 5:13:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

If the contents of the dialog is a different page (when you use the dialog's ContentUrl property), then that page and the hosting page are two different pages. In this case the dialog page is hosted inside an iframe, so you can do something like this to close the dialog:

Code: JavaScript
//Close dialog "Dialog1" in the parent window from inside an iframe
parent.eo_GetObject("Dialog1").close();


Note the second half of the code:

Code: JavaScript
eo_GetObject("Dialog1").close();


Is what you would do if you wish to close the dialog in the same page. However since in this case you are calling from inside an iframe, so you would add "parent" to it.

Hope this helps.

Thanks!




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.