ScriptLink 类
提供用于注册资源如页面上的脚本,以便他们可以呈现页面时请求属性和方法。
继承层次结构
System.Object
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.ScriptLink
命名空间: Microsoft.SharePoint.WebControls
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class ScriptLink _
Inherits SPControl
用法
Dim instance As ScriptLink
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class ScriptLink : SPControl
备注
If you register a .js file by adding a ScriptLink control to an .aspx page, the control registers all .js dependencies. To import the various "SP" namespaces, such as those listed at ECMAScript Object Model Reference, you must register the control as an on-demand script by specifying OnDemand="true". When you register the script, use the SP.SOD.execute or SP.SOD.executeFunc method to execute the script.
线程安全性
该类型的任何公共 静态 (已共享 在 Visual Basic 中) 成员都是线程安全的。不保证任何实例成员都是线程安全的。