Skip to main content

ASPxPopupControl.CloseAction Property

Gets or sets a value that specifies which action forces a displayed popup window to close.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web


public CloseAction CloseAction { get; set; }

Property Value

Type Default Description
CloseAction OuterMouseClick

One of the CloseAction enumeration values.

Available values:

Name Description

Specifies that a popup element can’t be closed via an end-user interaction, but can be closed programmatically via specific client script methods.


Specifies that a popup element is closed when clicking its close button (if any).


Specifies that a popup element is closed when clicking a mouse button outside the popup element.


Specifies that a popup element is closed when the mouse cursor moves out of it.


A displayed popup window may be closed in response to a specific mouse action performed on the client side (such as a mouse click or mouse movement). Use the CloseAction property to specify the precise client action which will hide the popup control’s popup window.


This example demonstrates how to add OK and Cancel buttons to a popup window of the ASPxPopupControl. It shows how to process new data when the OK button is pressed, and how to close the popup window without saving anything, when Cancel is pressed.

View Example

<dx:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="170px" ClientInstanceName="txtMain"
    ClientEnabled="False" Text="test message">
<dx:ASPxButton ID="ASPxButton1" runat="server" Text="Edit..." AutoPostBack="False">
    <ClientSideEvents Click="function(s, e) { txtPopup.SetText(txtMain.GetText()); popupControl.Show(); }" />
<dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" ClientInstanceName="popupControl"
    Height="83px" Modal="True" CloseAction="CloseButton" Width="207px" AllowDragging="True"
    PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter">
        <dx:PopupControlContentControl runat="server">
            Text:<dx:ASPxTextBox ID="ASPxTextBox2" runat="server" Width="170px" ClientInstanceName="txtPopup">
            <br />
            <br />
            <table style="border: none">
                        <dx:ASPxButton ID="btnOK" runat="server" AutoPostBack="False" Text="OK" Width="80px"
                            <ClientSideEvents Click="function(s, e) { popupControl.Hide();
                                    // Processes data on the client
                                    e.processOnServer = true;
                                    // Processes data on the server
                                }" />
                        <dx:ASPxButton ID="btnCancel" runat="server" AutoPostBack="False" ClientInstanceName="btnCancel"
                            Text="Cancel" Width="80px">
                            <ClientSideEvents Click="function(s, e) { popupControl.Hide(); }" />
using System;

public partial class _Default : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {

    protected void btnOK_Click(object sender, EventArgs e) {
        // Processes data on the server
        ASPxTextBox1.Text = ASPxTextBox2.Text;

See Also:

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CloseAction property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also