PrepAway - Latest Free Exam Questions & Answers

Which two actions should you perform?

You are implementing an ASP.NET application that makes extensive use of JavaScript libraries. Not
all pages use all scripts, and some scripts depend on other scripts. When these libraries load
sequentially, some of your pages load too slowly. You need to use the ASP.NET Ajax Library Script
Loader to load these scripts in parallel. Which two actions should you perform? (Each correct answer
presents part of the solution. Choose two.)

PrepAway - Latest Free Exam Questions & Answers

A.
In your site’s master page, add a call to Sys.loader.defineScripts to define each of the scripts that
are used in the site.

B.
In your site’s master page, add a call to Sys.loader.registerScript to define each of the scripts that
are used in the site.

C.
In each page that uses scripts, add a call to Sys.get for each script that is needed in that page.

D.
In each page that uses scripts, add a call to Sys.require for each script that is needed in that page.

Explanation:
The ASP.NET Ajax Library’s Script Loader provides a flexible way to load scripts required by a page as
well as any dependencies that may be needed. Because it loads scripts in parallel the page’s load
time is minimized and the amount of code needed to load scripts, their dependencies and

components is significantly reduced. To load ASP.NET Ajax Library or jQuery scripts a collection
called Sys.scripts (defined in the ASP.NET Ajax Library’s Start.js file) can be used along with a call to
Sys.require. In cases where a custom script has dependencies on one or more scripts a custom
metadata file can be created to define the dependencies. This metadata file can define all the scripts
involved using the Script Loader’s Sys.loader.defineScripts function. The metadata script defines the
custom scripts to load as well as any dependencies they may have. HOW TO Load Required Scripts
(http://www.asp.net/ajaxLibrary/HOW%20TO%20Load%20Required%20Scripts.ashx)
HOW TO Load a Custom Script with Dependencies
(http://www.asp.net/ajaxlibrary/HOW%20TO%20Load%20a%20Custom%20Script%20with%20De
pendencies.ashx)


Leave a Reply