ASPxPopupControl.LoadContentViaCallback Property
Gets or sets a value specifying the content loading mode for the ASPxPopupControl.
Namespace: DevExpress.Web
Assembly:
DevExpress.Web.v20.2.dll
NuGet Package:
DevExpress.Web
Declaration
Property Value
Available values:
Name |
Description |
None
|
Specifies that the content is always (initially) rendered inside popup windows.
|
OnFirstShow
|
Specifies that loading of popup window contents starts when a popup window is invoked for the first time.
|
OnPageLoad
|
Specifies that loading of the popup window contents starts immediately after the entire page has been loaded.
|
Use the LoadContentViaCallback property to control when a popup window’s content should be loaded - always, on page load, or when the window is first shown.
Using the postponed load of popup window contents (by setting the LoadContentViaCallback property to LoadContentViaCallback.OnPageLoad or LoadContentViaCallback.OnFirstShow), you can enhance the response time of your web page on its initial load.
Note that you can also update the content of popup windows programmatically, on demand (by using the client ASPxClientPopupControlBase.PerformCallback method).
On-demand window loading is realized by sending a callback to the server for the popup window’s content. During callback, a specific loading panel can be displayed within the window.
Example
At present, ASPxPopupControl does not have the built-in capability to resize nested controls when it's resizing. This example illustrates how to automatically resize controls places inside the popup.
To accomplish this task, execute the following steps:
Set the ScrollBars property to "Auto". This option will allow the popup control to evaluate the content width and height.
Handle the AfterResizing event. In this event handler, call the AdjustControl method for a desired control to force it to reevaluate its size.
Place the control into the <div style="height: 100%; width: 100%; overflow: hidden"> element. This element is necessary to overcome scrollbars that can be shown when ScrollBars="Auto" is set.
View Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<head runat="server">
<title>How to resize ASPxSplitter placed inside ASPxPopupControl when resizing ASPxPopupControl
</title>
<script type="text/javascript">
function OnClick(s, e) {
ASPxPopupControl1.Show();
}
function OnAfterResizing() {
splitter.AdjustControl();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" Height="500px" Width="500px"
ScrollBars="Auto" AllowResize="true" LoadContentViaCallback="OnFirstShow">
<ClientSideEvents AfterResizing="OnAfterResizing" />
<ContentCollection>
<dx:PopupControlContentControl ID="PopupControlContentControl2" runat="server" SupportsDisabledAttribute="True">
<div style="height: 100%; width: 100%; overflow: hidden">
<dx:ASPxSplitter ID="ASPxSplitter2" runat="server" Width="100%" Height="100%" ClientInstanceName="splitter">
<Panes>
<dx:SplitterPane>
<ContentCollection>
<dx:SplitterContentControl ID="SplitterContentControl3" runat="server" SupportsDisabledAttribute="True">
</dx:SplitterContentControl>
</ContentCollection>
</dx:SplitterPane>
<dx:SplitterPane>
<ContentCollection>
<dx:SplitterContentControl ID="SplitterContentControl4" runat="server" SupportsDisabledAttribute="True">
</dx:SplitterContentControl>
</ContentCollection>
</dx:SplitterPane>
</Panes>
</dx:ASPxSplitter>
</div>
</dx:PopupControlContentControl>
</ContentCollection>
</dx:ASPxPopupControl>
</div>
<dx:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="False" Text="Show PopUp">
<ClientSideEvents Click="OnClick" />
</dx:ASPxButton>
</form>
</body>
</html>
Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
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="Default.aspx.vb" Inherits="_Default" %>
<head runat="server">
<title>How to resize ASPxSplitter placed inside ASPxPopupControl when resizing ASPxPopupControl
</title>
<script type="text/javascript">
function OnClick(s, e) {
ASPxPopupControl1.Show();
}
function OnAfterResizing() {
splitter.AdjustControl();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<dx:ASPxPopupControl ID="ASPxPopupControl1" runat="server" Height="500px" Width="500px"
ScrollBars="Auto" AllowResize="true" LoadContentViaCallback="OnFirstShow">
<ClientSideEvents AfterResizing="OnAfterResizing" />
<ContentCollection>
<dx:PopupControlContentControl ID="PopupControlContentControl2" runat="server" SupportsDisabledAttribute="True">
<div style="height: 100%; width: 100%; overflow: hidden">
<dx:ASPxSplitter ID="ASPxSplitter2" runat="server" Width="100%" Height="100%" ClientInstanceName="splitter">
<Panes>
<dx:SplitterPane>
<ContentCollection>
<dx:SplitterContentControl ID="SplitterContentControl3" runat="server" SupportsDisabledAttribute="True">
</dx:SplitterContentControl>
</ContentCollection>
</dx:SplitterPane>
<dx:SplitterPane>
<ContentCollection>
<dx:SplitterContentControl ID="SplitterContentControl4" runat="server" SupportsDisabledAttribute="True">
</dx:SplitterContentControl>
</ContentCollection>
</dx:SplitterPane>
</Panes>
</dx:ASPxSplitter>
</div>
</dx:PopupControlContentControl>
</ContentCollection>
</dx:ASPxPopupControl>
</div>
<dx:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="False" Text="Show PopUp">
<ClientSideEvents Click="OnClick" />
</dx:ASPxButton>
</form>
</body>
</html>
See Also