Welcome Guest Search | Active Topics | Sign In | Register

Close a open dialog after running server side code Options
Erni
Posted: Saturday, May 19, 2012 7:03:19 AM
Rank: Member
Groups: Member

Joined: 5/19/2010
Posts: 22

On a dialog (content loading using "ContentUrl") I have:
a) one asp text field. Needed to show and get some input
b) one asp command button to save the last input from the text - field.

Pressing the command button I'm running the code to update the database.
All perfect. Now at the end, I need to close the dialog.

I found some other tips here to use a callback panel but no running example
that helps me to fix exact my problem.

Thanks for a short response.
eo_support
Posted: Saturday, May 19, 2012 9:39:36 AM
Rank: Administration
Groups: Administration

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

The key is you need to call JavaScript code inside the parent page (the page that contains the dialog) from the ContentUrl page. In order to do that, you basically just do something like this in your ContentUrl page:

Code: JavaScript
parent.someFunction();


Here "someFunction" would be a function that you place in your parent page that can do whatever you want. For example, you can call dialog.close() inside that function to close the dialog:

Code: JavaScript
//Get the dialog object
var dialog = eo_GetObject("Dialog1");

//Close the dialog
dialog.close();


Hope this helps. Please feel free to let us know if you still have any questions.

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.