SplitterPane.ContentUrl Property
Gets or sets the URL of a specific web page to be displayed within a pane.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
#Property Value
Type | Default | Description |
---|---|---|
String | String. |
A string value that specifies a page’s URL. |
#Remarks
Use the ContentUrl property to specify the URL of a web page which should be loaded into, and displayed within, the current pane. A relative or an absolute URL can be used.
The ASPxClientSplitterPane.SetContentUrl and ASPxClientSplitterPane.GetContentUrl methods can be used to specify and obtain the URL of a pane’s content web page on the client side.
Note
It’s necessary to set the Content
The AutoHeight property is not in effect if the ContentUrl property is specified. The example below demonstrates how to change the size of a pane based on the size of its content:
<dx:ASPxSplitter ID="ASPxSplitter1" runat="server" ClientInstanceName="splitter"
Width="100%">
<Panes>
<dx:SplitterPane ContentUrl="ContentPage.aspx" Name="ContentUrlPane">
</dx:SplitterPane>
<dx:SplitterPane>
</dx:SplitterPane>
</Panes>
<ClientSideEvents PaneContentUrlLoaded="CalculateSize"/>
</dx:ASPxSplitter>
function CalculateSize() {
var iframeElement = splitter.GetPaneByName('ContentUrlPane').GetContentIFrame();
var iframe = GetFrameOfIFrame(iframeElement);
var doc = iframe.document;
splitter.SetHeight(doc.documentElement.offsetHeight);
}
function GetFrameOfIFrame(iframeElement) {
var name = (new Date()).toString();
var backup = iframeElement.contentWindow.name;
iframeElement.contentWindow.name = name;
var frameIndex = this.internalGetFrameByWindowName(name);
iframeElement.contentWindow.name = backup;
return window.frames[frameIndex];
}
function internalGetFrameByWindowName(name) {
var count = window.top.frames.length;
for (var i = 0; i < count; i++) {
if (window.top.frames[i].window.name === name)
return i;
}
return -1;
}