SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 179 | Next

Robin Pars, Laurence Moroney, and John Grieb

"Foundations of ASP.NET AJAX"

Application.add_init(function() {
$create(Sys.UI._Timer, {"enabled":true,"interval":2000,"uniqueID":"Timer1"},
null, null, $get("Timer1"));
});
// -->




The ASP.NET AJAX server controls emit JavaScript functions that copy and build a
new innerHTML property of the or
tags that contain the value getting updated.
They are also responsible for generating a request on XMLHttpRequest and a callback for
when the client request is complete. The callback then builds HTML code to put on the
innerHTML property of the named or
tags.
This is basically how the UpdatePanel works under the hood. It uses
Sys.WebForms.PageRequestManager to set up an asynchronous callback. These scripts are all
automatically generated by the ScriptManager. Near the end of the source in the last lines
of script in the page, you can also see the parameters of the Timer control being passed
via JavaScript with the interval set to two seconds and the ID of the control being Timer1.
Delving deeper into the generated script details piece by piece would fast take us beyond
the scope of this chapter.


Pages:
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191