2. The Modal.Close() method defined in Daypilot.Modal-2.7.cs/Daypilot.Modal-2.7.vb can be called on the server side from the modal content page to close the dialog. It's not possible to close the modal on the server side from the parent page.
3. If you want to close the modal using JavaScript:
If you have the modal instance reference ("modal") you can call .close() method:
modal.close();
If you don't have the instance reference (e.g. in the modal content page):
DayPilot.Modal.close();
If you call DayPilot.Modal.close() from the modal content you need to include modal.js in the content page as well.
Let me know if it didn't help.
Comment posted by mrplatypus 8 years ago.
Dan,
Forgot to add: the popup form also has an update panel..
Would that be preventing the close of the modal form?
Comment posted by Dan Letecky [DayPilot] 8 years ago.
Yes, that might be the problem. The Modal.Close() method overrides the response. That's a kind of workaround which only works with the standard PostBack.
You'd have to replace it by injecting the client-side close() call in the button click handler using RegisterClientScriptBlock().
Comment posted by Dan Letecky [DayPilot] 8 years ago.
Update: The latest version of DayPilot.Modal already uses RegisterClientSideScript() instead of response overriding so it should be compatible with UpdatePanel.
Comment posted by mrplatypus 8 years ago.
Dan,
Please would you provide me with the java script I'd need to add to the registerClientScriptBlock?
Is there much difference between the version 2.2 and 2.7 of the modal javascript file?
I'm mindful that making too many changes now would have unforeseen issues..
mrplatypus..
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.