Extend ASP.NET AJAX Client-Side Function - The Server-Side Way
page 6 of 11
by Xianzhong Zhu
Feedback
Average Rating: 
Views (Total / Last 10 Days): 46717/ 95

Further Discussion

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.


View Entire Article

User Comments

No comments posted yet.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-25 12:20:35 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search