Class ModalDialog

This control allows creating client side pop up window that blocks out the background and brings a dialog to the foreground. This control can be used to replace ugly alert or prompt boxes to pop up rich dialogs that must be edited modally. Any dialog can be popped up like

The background can be just an opaque color with a transparency value - the default is black at 70% for example which gives a grey looking overlay - or can be a custom Html element that is expanded and then made transparent as in the following figure.


The control is based on DragPanel so the dialogs can be draggable and closable. Events are available to fire when a button or the close button is clicked with event firing either on the client or server.

The client side counter part class can be used without this server side control and allows a few extra features, such as a mechanism to display a dialog without controls on the page to map to.

public class ModalDialog : DragPanel

Class Members




Shows the dialog as designed without any customizations

public void Show()

public void Show(string message,     string title,     bool asHtml)


The opacity of of the overlay background in a decimal percentage. Default to .85


Client side event handler that is fired when anything is clicked inside of the dialog. This can be a button, a hyperlink or any element.


Override to force simple IDs all around


The client ID of the element that receives the content message. If not specified the message is written to the body of the control.


When true fades in the background by slowly increasing opacity of the background


ID of a header element that receives the Title when calling showDialog() on the client. Optional - if not specified the header is not set which means the dialog displays as designed.


Optional Id that is to be used for the shaded Overlay. This allows you to create a colored or otherwise designed background that pops over the existing content.


Override to force simple IDs all around


The zIndex value for the overlay and dialog. This value must be higher than any other control on the page in order for the dialog to pop up on top.


Namespace: Westwind.Web.Controls
Assembly: westwind.web.webforms.dll

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic