Skip to main content
A newer version of this page is available. .
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.v19.2.dll

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).

For more details, see the E1080 Code Central example.

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 end-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.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="DevExpress.Web.v9.1" Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dxpc" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.1" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <dxe:ASPxCheckBox ID="cbShowPageScrollbarWhenModal" runat="server" Text="ShowPageScrollbarWhenModal" />
            <br />
            <dxe:ASPxCheckBox ID="cbAutoUpdatePosition" runat="server" Text="AutoUpdatePosition" />
            <br />
            <dxe:ASPxButton ID="btnShow" runat="server" Text="Show">
            </dxe:ASPxButton>
            <dxpc: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>
                    <dxpc: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>
                    </dxpc:PopupControlContentControl>
                </ContentCollection>
               <ClientSideEvents Init="function(s, e) { s.Show(); }" />
            </dxpc:ASPxPopupControl>
            <div style="height: 2000px" />
        </div>
    </form>
</body>
</html>
See Also