Welcome Guest Search | Active Topics | Sign In | Register

Trouble Closing Dialog Options
Versile Johnson
Posted: Saturday, January 5, 2008 11:31:02 PM
Rank: Advanced Member
Groups: Member

Joined: 8/25/2007
Posts: 34
Hi,

I am waiting until a user logs in, and doing a check if the user has completed a poll. If the poll has not been completed I am using a dialog to pass another page survey.aspx with a wizard control and code behind to complete the poll. Everything works as expected until the user gets done with the poll. I've tried every variation of javascript and/or server side code I could imagine. At the end of the wizard is a finish button, which for me executes server side code, the end of the server side code I try executing javascript sitting on the master page to close but no luck. I'm grasping for straws how to close this dialog from the survey page via code behind or client side. Any suggestions?
eo_support
Posted: Sunday, January 6, 2008 5:25:13 AM
Rank: Administration
Groups: Administration

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

The easiest way to close a dialog from code behind to set the dialog's InitialState to Hidden.

Thanks
Versile Johnson
Posted: Sunday, January 6, 2008 8:21:38 AM
Rank: Advanced Member
Groups: Member

Joined: 8/25/2007
Posts: 34
Thanks for the quick response as always, but as indicated above I'm using contentURL so the code behind is in a seperate page as the dialog which is why I was trying to use javascript.
eo_support
Posted: Sunday, January 6, 2008 3:08:14 PM
Rank: Administration
Groups: Administration

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

When the page behind is in a seperate page, it get a little bit complicated to close the dialog. Say you have Page1.aspx and Page2.aspx, which appears as ContentUrl inside a dialog in Page1, you would have to render some JavaScript inside Page2.aspx to call code in Page.aspx. You can try some code like this:

Page2:

Code: HTML/ASPX
<asp:Panel id="panCloseDialogScript" Visible="False">
    <script type="text/javascript">
    parent.CloseDialog();
    </script>
</asp:Panel>


Where CloseDialog is a JavaScript function you placed in Page1:

Code: JavaScript
function CloseDialog()
{
    Dialog1.close();
}


To close the dialog in code behind, you would set panCloseDialogScript's Visible to true, which triggers parent.CloseDialog, which calls the dialog's close method to close the dialog.

Thanks
Versile Johnson
Posted: Sunday, January 6, 2008 4:21:11 PM
Rank: Advanced Member
Groups: Member

Joined: 8/25/2007
Posts: 34
As always, thank you very much - worked like a charm! Your controls have been a foundation for my corporate based websites where 500+ people rely on them on a daily basis to manage, print, and coordinate work and schedules. I can't wait for someone at your organization to dream up the next control we will get some use out of!

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.