ScriptLink Class
Provides properties and methods for registering resources, such as scripts, on a page so that they can be requested when the page is rendered.
System.Object
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.ScriptLink
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.ScriptLink
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
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 JavaScript Class Library, 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.
Issue with the ScriptLink control when using it on pages published on a HTTPS site
In beta 2 I found an issue with ScriptLink control that causes constant security warning in web browser (This page contains both secure and nonsecure items in IE7, Do you want to view only the webpagecontent that was delivered securely? in IE8) when visiting the site using HTTPS.
For details, check this post:
http://pholpar.wordpress.com/2010/03/26/scriptlink-control-causes-issues-when-accessing-a-site-through-https/
For details, check this post:
http://pholpar.wordpress.com/2010/03/26/scriptlink-control-causes-issues-when-accessing-a-site-through-https/
- 3/26/2010
- Peter Holpar