Here's a nice little sample on using modal Forms in ASP.NET. It was written by Lou Flees for CodeProject.
From his introduction:
ModalPopupExtender control provided by the ASP.NET AJAX Control Toolkit allows the display of content in a div panel that floats in the middle of the page and prevents the user from interacting with the rest of the page until the div panel has been closed, thus creating a modal form type of entry on a web page. This is really useful technology but I wanted to make a few improvements in this modal form-like interface.
Specifically I wanted to:
- Create a panel like control into which I can place content which will be displayed in the modal form without having to include a separate
ModalPopupExtender control on the page.
- Standardize the look of the modal form by automatically including a form-like header when the form is displayed and allowing both the header and content to be styled using stylesheets.
- Allow the modal form to be dragged around the page like a real modal form.
- Provide the modal form with a more opaque drop shadow than the
ModalPopupExtender normally provides.