IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
You must reference the client component from the view class. You do this in the override of the GetScriptReference method. In it you must create a script reference for your client component. When creating the reference, you must specify the name of the embedded resource that contains the client component and the assembly it resides in. The name of the resource follows the same naming conventions as the name of the template.
Overriding the GetScriptReference method
public override IEnumerable<
System.Web.UI.ScriptReference
> GetScriptReferences()
{
var res = new List<
>();
var assemblyName = this.GetType().Assembly.GetName().ToString();
res.Add(new System.Web.UI.ScriptReference("NewsRotator.Resources.DesignerView1.js", assemblyName));
return res.ToArray();
}
You must specify a script descriptor for the view. This is done in the GetScriptDescriptors override.
GetScriptDescriptors
Overriding the GetScriptDescriptors method
System.Web.UI.ScriptDescriptor
> GetScriptDescriptors()
var descriptor = new ScriptControlDescriptor(this.GetType().FullName, this.ClientID);
return new[] { descriptor };
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important