search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

I've managed to open a modal form from code-behind, I now need to close it.. Please advise on how....

Asked by mr platypus
8 years ago.

Hi Dan and Team,

In a recent post:
http://forums.daypilot.org/Topic.aspx/3324/is-it-possible-to-display-a-daypilot-modal-dialog-form-from

I've gotten that bit working and the functionality I require working...

I now need to close the modal popup box - I've tried various combinations of Modal.Close, with and without parameters (this), (this, "OK"), (this, null) but this doesn't close the modal box from within the code-behind file..

Please help..

Thanks

mrplatypus (aka Dave)

Comment posted by mr platypus
8 years ago.

As an addendum - The modal form links off to another page...
Both source and destination web forms use UpdatePanels..

How do I overcome this additional complexity please?

Thanks & Regards

mrplatypus (aka Dave)

Answer posted by Dan Letecky [DayPilot]
8 years ago.

See also the explanation here:
http://forums.daypilot.org/Topic.aspx/3328/which-java-script-files-and-functions-are-absolutely-essent

1. The source page using UpdatePanel should be no problem (you open the modal using manual JavaScript).

2. There might be a problem with the target page if you want to use the server-side helper to close the modal dialog. The UpdatePanel intercepts PostBacks and the helper may not work properly.

You should be able to close the modal dialog from the server-side using ScriptManager.RegisterStartupScript:

ScriptManager1.RegisterStartupScript(typeof(Page), "close", "parent.DayPilot.ModalStatic.close();");
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.