ASPxPopupControlBase.AllowDragging Property
Specifies whether end users can drag a control’s window.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v19.2.dll
Declaration
Property Value
Type |
Default |
Description |
Boolean |
**false** |
true, if end users can drag a window; otherwise, false.
|
Use the AllowDragging property to control whether end users can drag a window to another position in a web page.
Example
If a content of the ASPxPopupControl is loaded slowly, you can show a loading panel reflecting this process.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestPage.aspx.cs" Inherits="TestPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2> Page content </h2>
</div>
</form>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxLoadingPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<!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>ASPxLoadingPanel within ASPxPopupControl</title>
<script language="javascript" type="text/javascript">
var showPopup = true;
var iframe;
function OnPopupInit (s, e) {
iframe = popup.GetContentIFrame();
/* the "load" event is fired when the content has been already loaded */
ASPxClientUtils.AttachEventToElement(iframe, 'load', OnContentLoaded);
}
function OnPopupShown (s, e) {
if (showPopup)
lp.ShowInElement(iframe);
}
function OnContentLoaded (e) {
showPopup = false;
lp.Hide();
}
function OnButtonClick (s, e) {
showPopup = true;
popup.SetContentUrl(txt.GetText());
popup.Show();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
<b>Web site URL:</b>
</td>
<td>
<dx:ASPxTextBox ID="txt" ClientInstanceName="txt" runat="server" Width="250px" Text="TestPage.aspx">
</dx:ASPxTextBox>
</td>
</tr>
</table>
<dx:ASPxLoadingPanel ID="lp" runat="server" ClientInstanceName="lp">
</dx:ASPxLoadingPanel>
<dx:ASPxPopupControl ID="popup" runat="server" AllowDragging="true" AllowResize="true"
Height="400px" Width="600px" ClientInstanceName="popup" ContentUrl="javascript:void(0);"
PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter">
<ClientSideEvents Init="OnPopupInit" Shown="OnPopupShown" />
</dx:ASPxPopupControl>
<dx:ASPxButton ID="btn" runat="server" Text="Show the Site" AutoPostBack="false">
<ClientSideEvents Click="OnButtonClick" />
</dx:ASPxButton>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class TestPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Thread.Sleep(3000);
}
}
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DevExpress.Web.ASPxClasses;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
<%@ Page Language="vb" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxLoadingPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.12.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<!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>ASPxLoadingPanel within ASPxPopupControl</title>
<script language="javascript" type="text/javascript">
var showPopup = true;
var iframe;
function OnPopupInit (s, e) {
iframe = popup.GetContentIFrame();
// the "load" event is fired when the content has been already loaded
ASPxClientUtils.AttachEventToElement(iframe, 'load', OnContentLoaded);
}
function OnPopupShown (s, e) {
if (showPopup)
lp.ShowInElement(iframe);
}
function OnContentLoaded (e) {
showPopup = false;
lp.Hide();
}
function OnButtonClick (s, e) {
showPopup = true;
popup.SetContentUrl(txt.GetText());
popup.Show();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
<b>Web site URL:</b>
</td>
<td>
<dx:ASPxTextBox ID="txt" ClientInstanceName="txt" runat="server" Width="250px" Text="TestPage.aspx">
</dx:ASPxTextBox>
</td>
</tr>
</table>
<dx:ASPxLoadingPanel ID="lp" runat="server" ClientInstanceName="lp">
</dx:ASPxLoadingPanel>
<dx:ASPxPopupControl ID="popup" runat="server" AllowDragging="true" AllowResize="true"
Height="400px" Width="600px" ClientInstanceName="popup" ContentUrl="javascript:void(0);"
PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter">
<ClientSideEvents Init="OnPopupInit" Shown="OnPopupShown" />
</dx:ASPxPopupControl>
<dx:ASPxButton ID="btn" runat="server" Text="Show the Site" AutoPostBack="false">
<ClientSideEvents Click="OnButtonClick" />
</dx:ASPxButton>
</div>
</form>
</body>
</html>
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Threading
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Partial Public Class TestPage
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Thread.Sleep(3000)
End Sub
End Class
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports DevExpress.Web.ASPxClasses
Partial Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
End Sub
End Class
<%@ Page Language="vb" AutoEventWireup="true" CodeFile="TestPage.aspx.vb" Inherits="TestPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2> Page content </h2>
</div>
</form>
</body>
</html>
See Also