15.1. Debug and Release Scripts

ASP.NET 3.5 ships with debug and release versions of client script files that drive functionality in AJAX-enabled pages. The scripts are embedded in the System.Web.Extensions.dll assembly (which is installed in the Global Assembly Cache) as resources. Figure 15-1 shows what the script resources look like when viewed in Reflector (download Reflector from www.red-gate.com/products/reflector/index.htm).

Understanding how to switch between debug and release scripts can simplify the process of debugging ASP.NET AJAX applications and make it easier to step through Microsoft's client-side script files as well as any custom script files you may write.

Figure 15-1. Figure 15-1

To tell the ASP.NET AJAX framework which version of the library scripts you want to use, you have to set the ScriptManager's ScriptMode property to one of four values defined in a ScriptMode enumeration, as shown in the following table.

MemberDescription
AutoThe client script files to use are determined at runtime based upon configuration settings in web.config and machine.config. If the deployment element's retail attribute is set to false (the default) and the page element's debug attribute is set to true, debug scripts are used. Otherwise, release scripts are used.
InheritWhen applied directly to the ScriptManager control, it is the same as using Auto. When applied to a ScriptReference ...

Get Professional ASP.NET 3.5 AJAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.