O'Reilly logo

Professional ASP.NET 3.5 AJAX by Matt Gibbs, Dan Wahlin, Bill Evjen, Dave Reed

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required