Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
ASP.NET
ASP.NET 4
Microsoft Ajax
Sys Namespace
 load Event
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2010/.NET Framework 4

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

Raised after all scripts have been loaded and the objects in the application have been created and initialized.

Sys.Application.add_load(handler);
Sys.Application.remove_load(handler);
handler

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

Attach delegate functions to the load event to complete any tasks that must be performed after the objects have been created in the application and when they can reference each other. The add_load accessor binds a delegate function to the load event, and the remove_load accessor unbinds it. The load event occurs immediately before the pageLoad event.

The following example shows how to add a handler function to the load event. The event handler redirects the user to another page if the application is loaded outside business hours.

C#
// Attach a handler to the load event.
Sys.Application.add_load(applicationLoadHandler);

function applicationLoadHandler() {
    // Redirect to alternate page if not business hours.
    var d = new Date();
    if (!(8 < d.getHours() < 17)) {
        window.location = "AfterHours.aspx";
    }
}

Reference

Other Resources

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Sys.Application.add_load(handler);      deadheat daddy   |   Edit   |   Show History
Sys.Application.add_load(handler);
Sys.Application.remove_load(handler);cell+5418527800+location
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker