ScriptReferenceBase.NotifyScriptLoaded 属性

定义

注意

NotifyScriptLoaded is no longer required in script references.

获取或设置一个值,该值指示 ScriptResourceHandler 对象是否在 ECMAScript (JavaScript) 文件末尾自动添加代码来调用 Sys.Application 类的客户端 NotifyScriptLoaded 方法。

public:
 property bool NotifyScriptLoaded { bool get(); void set(bool value); };
public bool NotifyScriptLoaded { get; set; }
[System.Obsolete("NotifyScriptLoaded is no longer required in script references.")]
public bool NotifyScriptLoaded { get; set; }
member this.NotifyScriptLoaded : bool with get, set
[<System.Obsolete("NotifyScriptLoaded is no longer required in script references.")>]
member this.NotifyScriptLoaded : bool with get, set
Public Property NotifyScriptLoaded As Boolean

属性值

如果在 JavaScript 文件结尾自动调用了 Sys.Application.notifyScriptLoaded 方法,则为 true;如果用户代码调用 JavaScript 文件中已有的 Sys.Application.notifyScriptLoaded 方法,则为 false。 默认值是 true

属性

注解

NotifyScriptLoaded如果引用程序集中的脚本文件,并且脚本文件已包含调用 Sys.Application.notifyScriptLoaded 的代码,请将 属性false设置为 。 如果从脚本文件多次调用 Sys.Application.notifyScriptLoaded 方法,则会引发错误。

如果引用未嵌入程序集的独立脚本文件,则必须在脚本文件的末尾包含代码以调用 Sys.Application.notifyScriptLoaded 方法。 以下示例演示要包含在脚本文件末尾的代码。

if(typeof(Sys) !== "undefined) Sys.Application.notifyScriptLoaded();  

适用于