Robin Pars, Laurence Moroney, and John Grieb
"Foundations of ASP.NET AJAX"
CHAPTER 4 ?– ASP.NET AJAX CLIENT LIBRARIES 62
Figure 4-4. Displaying a currency value in US $
Once again, just as with the Date extension, if you plan to use any culture-specific
functionality, be sure to set the EnableScriptGlobalization property of the ScriptManager
control to true.
Object Extension
The Object extension in the ASP.NET AJAX client library provides some level of reflection
functionality to JavaScript types. This is a far cry from the rich feature set of reflection in
the .NET Framework, but it is a potentially useful functionality in JavaScript. The Object
extension contains methods to describe the type and the type name of an object. This
extension contains only two static-like methods, getType and getTypeName, as shown in
Table 4-7.
Table 4-7.Methods of the Object Extension
Method Name Description
getType Returns the type of a specified object
getTypeName Returns the type name of an object
Type discovery can be particularly useful when you need to control the logic flow
based on the type of a parameter or other variables. Consider the following script block: