Export (0) Print
Expand All

ScriptResourceDefinition.LoadSuccessExpression Property

.NET Framework 4.6 and 4.5

Gets or sets a JavaScript expression that is used to detect whether a JavaScript file loaded successfully.

Namespace:  System.Web.UI
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

public string LoadSuccessExpression { get; set; }

Property Value

Type: System.String
The JavaScript expression. The default is an empty string.

This property is used in conjunction with the ScriptManager.EnableCdnFallback property to render inline script that will revert to loading the library from a local server location if the script fails to load from the CDN.

For script libraries from Microsoft, this value is already set. If you want to register a script yourself and get CDN fallback support, you would set this property to an expression. For example, to test whether a jQuery library has been loaded, you can use an expression like the following:

typeof(window.jQuery) !== "undefined"

.NET Framework

Supported in: 4.6, 4.5
Show:
© 2015 Microsoft