Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
ASP.NET Reference
Client Reference
Sys Namespace
 init Event

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
Sys.Application.init Event

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

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

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

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.

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

C#
// 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'));
}

Reference

Other Resources

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker