Edit

Share via


ScriptResourceDefinition.LoadSuccessExpression Property

Definition

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

public:
 property System::String ^ LoadSuccessExpression { System::String ^ get(); void set(System::String ^ value); };
public string LoadSuccessExpression { get; set; }
member this.LoadSuccessExpression : string with get, set
Public Property LoadSuccessExpression As String

Property Value

The JavaScript expression. The default is an empty string.

Remarks

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"

Applies to