Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

Sys.Application.init Event

Raised after all scripts have been loaded but before objects are created.

Syntax

Sys.Application.add_init(handler);
Sys.Application.remove_init(handler);

Arguments

handler

The delegate function to bind or unbind from the init event.

Remarks

Attach delegate functions to the init event to complete tasks that must be performed before objects are created. The add_init accessor binds a delegate function to the init event, and the remove_init accessor unbinds it. For more information, see ASP.NET AJAX Client Life-Cycle Events.

Example

The following example shows how to add a handler to the init event. The event handler adds two custom controls to the page.

CS

// Attach a handler to the init event.
Sys.Application.add_init(applicationInitHandler);

function applicationInitHandler() {
    // Add two custom controls to the application.
    $create(Demo.HoverButton, {text: 'A HoverButton Control'}, 
        {click: start, hover: doSomethingOnHover, 
        unhover: doSomethingOnUnHover},
        null, $get('Button1'));
    $create(Demo.HighVis, null, null, null, $get('Button2'));
}