Use the HeaderTemplate property to control the default window’s header. The template defined using this property replaces the window header - in particular, the image, text and close button displayed with the header.
Note that any style settings defined for the header via the ASPxPopupControl.HeaderStyle (PopupControlStyles.Header for ASPxDockPanel) property are still in effect for the window’s header, whose content is specified using the HeaderTemplate property.
Once a template defined via the HeaderTemplate property is created within a control, it is instantiated within a container object of the PopupControlTemplateContainer type. This container object exposes a set of specific properties to which the template’s child controls can be bound.
The ASPxPopupControl does not allow a developer to prevent a PopupControl from being hidden when the CloseButton is clicked based on a custom criteria. A possible solution for this limitation is to use templates. You should add a button to the PopupControl's HeaderTemplate container and decide whether a PopupControl should be closed or not when this button is clicked.
<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default"MasterPageFile="~/MasterPage.master"%><%@RegisterAssembly="DevExpress.Web.v8.1, Version=8.1.6.0, Culture=neutral, PublicKeyToken=79868b8147b5eae4"Namespace="DevExpress.Web.ASPxPopupControl"TagPrefix="dxpc" %><asp:ContentContentPlaceHolderID="ContentPlaceHolder1"ID="CC"runat="Server"><inputid="Button1"style="width: 325px"type="button"value="Click button to show PopupControl" /><br /><dxpc:ASPxPopupControlID="ASPxPopupControl1"runat="server"PopupElementID="Button1"ClientInstanceName="popupControl"ShowCloseButton="False"><HeaderTemplate><divstyle="text-align:right;"><inputid="btn"type="button"value="close"onclick="
if(document.getElementById('checkBox').checked)
popupControl.Hide();
"/></div></HeaderTemplate><ContentCollection><dxpc:PopupControlContentControlrunat="server"><labelid="lbl">Check CheckBox to be able to close the PopupControl by clicking the Hide button</label><inputid="checkBox"style="width: 32px"type="checkbox"/></dxpc:PopupControlContentControl></ContentCollection></dxpc:ASPxPopupControl></asp:Content>
<%@PageLanguage="vb"AutoEventWireup="true"CodeFile="Default.aspx.vb"Inherits="_Default"MasterPageFile="~/MasterPage.master"%><%@RegisterAssembly="DevExpress.Web.v8.1, Version=8.1.6.0, Culture=neutral, PublicKeyToken=9B171C9FD64DA1D1"Namespace="DevExpress.Web.ASPxPopupControl"TagPrefix="dxpc" %><asp:ContentContentPlaceHolderID="ContentPlaceHolder1"ID="CC"runat="Server"><inputid="Button1"style="width: 325px"type="button"value="Click button to show PopupControl" /><br /><dxpc:ASPxPopupControlID="ASPxPopupControl1"runat="server"PopupElementID="Button1"ClientInstanceName="popupControl"ShowCloseButton="False"><HeaderTemplate><divstyle="text-align:right;"><inputid="btn"type="button"value="close"onclick="
if(document.getElementById('checkBox').checked)
popupControl.Hide();
"/></div></HeaderTemplate><ContentCollection><dxpc:PopupControlContentControlrunat="server"><labelid="lbl">Check CheckBox to be able to close the PopupControl by clicking the Hide button</label><inputid="checkBox"style="width: 32px"type="checkbox"/></dxpc:PopupControlContentControl></ContentCollection></dxpc:ASPxPopupControl></asp:Content>