Skip to main content

ASPxClientControlBase.Init Event

Occurs on the client side after the control has been initialized.

Declaration

Init: ASPxClientEvent<ASPxClientEventHandler<ASPxClientControlBase>>

Event Data

The Init event's data class is ASPxClientEventArgs.

Remarks

Write a handler for the Init event to perform specific operations after the control’s client object has been completely initialized on the client side.

Example

This example demonstrates how to resize the ASPxPageControl control to occupy the entire browser window (a Full Screen mode).

View Example: How to display the page control in full screen mode (100% width and height)

function OnInit(s, e) {
    AdjustSize();
    ASPxClientUtils.AttachEventToElement(window, "resize", function(evt) {
        AdjustSize();
    });
}
function AdjustSize() {
    var height = document.documentElement.clientHeight;
    pc.SetHeight(height);
}
<style type="text/css">
    body, html
    {
        padding: 0;
        margin: 0;
    }
</style>

<dx:ASPxPageControl ID="pc" runat="server" Height="100px" Width="100%" ClientInstanceName="pc" >
    <Paddings Padding="0px" />
    <!-- ... -->
    <ClientSideEvents Init="OnInit" />
</dx:ASPxPageControl>
See Also