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 a DevExpress ASP.NET control (for example, ASPxPageControl) to occupy the entire browser window (a Full Screen mode).
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-use-the-aspxpagecontrol-control-in-full-screen-mode-100-browser-width-and-height-e3940
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="DevExpress.Web.v11.2, Version=11.2.10.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.2, Version=11.2.10.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
Namespace="DevExpress.Web.ASPxClasses" 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></title>
<style type="text/css">
body, html
{
padding: 0;
margin: 0;
}
</style>
<script type="text/javascript">
function OnInit(s, e) {
AdjustSize();
ASPxClientUtils.AttachEventToElement(window, "resize", function(evt) {
AdjustSize();
});
}
function AdjustSize() {
var height = document.documentElement.clientHeight;
pc.SetHeight(height);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<dx:ASPxPageControl ID="pc" runat="server" ActiveTabIndex="0" Height="100px" ClientInstanceName="pc"
Width="100%">
<ContentStyle BackColor="LightGray">
</ContentStyle>
<Paddings Padding="0px" />
<TabPages>
<dx:TabPage Text="First">
<ContentCollection>
<dx:ContentControl runat="server">
</dx:ContentControl>
</ContentCollection>
</dx:TabPage>
<dx:TabPage Text="Second">
<ContentCollection>
<dx:ContentControl runat="server">
</dx:ContentControl>
</ContentCollection>
</dx:TabPage>
<dx:TabPage Text="Third">
<ContentCollection>
<dx:ContentControl runat="server">
</dx:ContentControl>
</ContentCollection>
</dx:TabPage>
</TabPages>
<ClientSideEvents Init="OnInit" />
</dx:ASPxPageControl>
</form>
</body>
</html>
See Also