To get better ideas of what we discussed above, when we run
the above ASP.NET sample page we can further dig into the source code sent to
the browser. Here, what most interests us is the $create statement generated
by the script descriptor that the ServHoverBehavior returned to the
ScriptManager control.
Listing 7
<script type="text/javascript">
<!--
Sys.Application.initialize();
Sys.Application.add_init(function() {
$create(ZXZSamples.MyHoverBehavior, {"hoverScript":"SetHoverCSS();",
"unhoverDelay":30, "unhoverScript":"SetUnhoverCSS();"}, null, null,
$get("panel1"));
});
// -->
</script>
Note how the $create statement is correctly injected into a
JavaScript function that handles the init event raised
by Sys.Application.
Now that everything goes smooth with the Extender, we are
ready to explore the second category of extending ASP.NET AJAX client-side
functionalities—the WebControl way.