Prev | Current Page 500 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"


CHAPTER 8 ?–  INTEGRATING CL IENT-SIDE SCRIPT 393
Figure 8-9. The UpDown control in action on a web form
If you add the following name/value pair to the @Page directive of the web form, it will force
the control to stop emitting JavaScript:
ClientTarget="downlevel"
The result in Figure 8-10 shows the time label changing on each button click because a
server postback occurs.
Figure 8-10. The UpDown control with EnableClientScript = ???False???
394 CHAPTER 8 ?–  I NTEGRAT ING CLI ENT-SI D E SCRIPT
As you can see, both client-side and server-side code work with aplomb. Viewing the
source code that is rendered into the form one can see the script block that is added that gives
the UpDown control its client side functionality:

The RegisterScriptResource call to ClientScriptManager emits a