ASPxClientPopupControlBase.SetContentUrl(url) Method
Sets the URL to point to the web page that should be loaded into, and displayed within the control’s window.
Declaration
SetContentUrl(
url: string
): void
Parameters
Name | Type | Description |
---|---|---|
url | string | A string value specifying the URL to the web page displayed within the control’s window. |
Remarks
The SetContentUrl method can be used on the client side to specify the URL of the web page to be displayed as the content of the control’s window. The web page’s URL can be either an absolute or relative path.
Example
The following example demonstrates how use the popup control’s client-side functionality to display the loading panel in a pop-up window when content is loading slowly:
The main idea is to call the popup control’s client-side GetContentIFrame method to get the control’s IFrame. Then use the loading panel’s ShowInElement(htmlElement) method to display the panel within the IFrame. When content is loaded, hide the loading panel.
<dx:ASPxLoadingPanel ID="lp" runat="server" ClientInstanceName="lp" />
<dx:ASPxPopupControl ID="popup" runat="server" ... >
<ClientSideEvents Init="OnPopupInit" Shown="OnPopupShown" />
</dx:ASPxPopupControl>
var showPopup = true;
var iframe;
function OnPopupInit (s, e) {
iframe = popup.GetContentIFrame();
ASPxClientUtils.AttachEventToElement(iframe, 'load', OnContentLoaded);
}
function OnPopupShown (s, e) {
if(showPopup)
lp.ShowInElement(iframe);
}
function OnContentLoaded (e) {
showPopup = false;
lp.Hide();
}