Skip to main content
Tab

ASPxPopupControl.AutoUpdatePosition Property

Gets or sets the value that specifies whether the default popup window’s position is updated automatically, when required.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(false)]
public bool AutoUpdatePosition { get; set; }

Property Value

Type Default Description
Boolean false

true if the popup window’s position is updated automatically; otherwise, false.

Remarks

The AutoUpdatePosition property is in effect if the default popup window is aligned at either a specific element explicitly defined via the ASPxPopupControl.PopupElementID property, or at the browser window’s center (the popup control’s ASPxPopupControl.PopupHorizontalAlign and ASPxPopupControl.PopupVerticalAlign properties are set to PopupHorizontalAlign.WindowCenter and PopupVerticalAlign.WindowCenter, respectively).

The AutoUpdatePosition property can be used to control whether the popup window’s position is updated automatically (after resizing the browser window, for instance).

Example

This example demonstrates the following capabilities of the ASPxPopupControl when its popup window is used in modal mode:

  • The ShowPageScrollbarWhenModal property allows the browser’s vertical scrollbar to be displayed providing users with a capability to scroll the document content while the modal popup window is being shown;

  • The AutoUpdatePosition property controls whether the popup window’s position should be automatically recalculated after performing some popup window resizing or document scrolling operations.

<dx:ASPxCheckBox ID="cbShowPageScrollbarWhenModal" runat="server" Text="ShowPageScrollbarWhenModal" />
<dx:ASPxCheckBox ID="cbAutoUpdatePosition" runat="server" Text="AutoUpdatePosition" />
<dx:ASPxButton ID="btnShow" runat="server" Text="Show" />

<dx:ASPxPopupControl ID="popup" runat="server" ShowOnPageLoad="true" PopupElementID="ASPxButton1" 
                     Modal="True" ShowPageScrollbarWhenModal="False" PopupHorizontalAlign="WindowCenter" 
                     PopupVerticalAlign="WindowCenter" HeaderText="Gladiator" AllowDragging="True" 
                     AllowResize="True" EnableAnimation="False">
    <ContentCollection>
        <dx:PopupControlContentControl runat="server">
            <span class="Gray"><b>Directed by:</b> Ridley Scott<br />
                <b>Year:</b> 2000</span><br />
            <br />
            <div style="font-family: Tahoma; font-size: 10px; color: #666666;">
                When a Roman general is betrayed and his family murdered by a corrupt prince, he
                comes to Rome as a gladiator to seek revenge.</div>
        </dx:PopupControlContentControl>
    </ContentCollection>
    <ClientSideEvents Init="function(s, e) { s.Show(); }" />
</dx:ASPxPopupControl>
protected void Page_Load(object sender, EventArgs e) {
    if(IsPostBack) {
        popup.ShowPageScrollbarWhenModal = cbShowPageScrollbarWhenModal.Checked;
        popup.AutoUpdatePosition = cbAutoUpdatePosition.Checked;
    }
}
See Also