Modal Dialog



I am able to open a modal dialog on a button click from the code behind by
placing a RegisterClientScriptBlock() method in the button click event
handler. This all works fine, but the problem is that when the modal box is
displayed, the parent page in the background goes blank until the dialog has
closed and returned.
I have to do it this way as there is a lot of server side processing needed
to get the arguments to pass into the dialog args, otherwise I would do it
all client side using html buttons. Is there any way to get the parent to
postpone posting back until the modal has shut?


Eliyahu Goldin

You call showModalDialog before the page has finished loading. That's why it
stays black. I suggest you to call showModalDialog in body's onload event.
This would be your scenario:
1. User clicks the button on the parent.
2. Server-side OnClick event calculates the parameters for the dialog and
puts them in hidden input controls.
3. Client-side onload event gets the parameters from the hidden inputs and
calls showModalDialog.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question