Content Studio Web Content Management System
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
The implementation of EPTBaseICS_ASDynamicCode receives in its implementation a reference to a collection of values of all
fields returned in result set and these value are stored in a DictionaryTKey, TValue collection passed via the EPTData parameter of the ICS_ASDynamicCode interface.
This dictionary will contain keys with the same name as you specified in the XMLFields and are returned.
The dynamic code functionality is mainly intended to be used with the component Script filtered documents but if you choose
supply your own script for each found row you must supply an implementation of an object that implements the EPTBaseICS_ASDynamicCode interface.
To access the Page you must use the Page variable. Ex: Page.Response.Write("");. If the page where the component is included is written in C#, the code must also be C#.
If you specified Gender and Name in one of the XMLField:s you can write the following code in your implementation:
There is one global key named documentid (usage ex. EPTData["documentid"];) that contains the id of the current document.
If you want do a lookup on a category you can use CSF_LookUpField method available in every Content Studio component:
[This is preliminary documentation and is subject to change.]
An implementation of the EPTBaseICS_ASDynamicCode interface that contains code to run before the data list is rendered.
Namespace: ContentStudio.Site.ActiveScripting.EPT
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax
Property Value
Type: EPTBaseICS_ASDynamicCodeRemarks
To access the Page you must use the Page variable. Ex: Page.Response.Write("");. If the page where the component is included is written in C#, the code must also be C#.
Examples
Visual C#
public class DynaCode : ContentStudio.Site.CodeBase, ContentStudio.Site.ActiveScripting.EPTBase.ICS_ASDynamicCode { void ContentStudio.Site.ActiveScripting.EPTBase.ICS_ASDynamicCode.Invoke(Dictionary<string, string> EPTData) { if (EPTData["Gender"].ToUpper() == "M") Page.Response.Write(Page.Server.HtmlEncode(EPTData["Name"]) + " is a male."; else Page.Response.Write(Page.Server.HtmlEncode(EPTData["Name"]) + " is a female."; } }
Visual Basic.NET
Public Class DynaCode Inherits ContentStudio.Site.CodeBase Implements ContentStudio.Site.ActiveScripting.EPTBase.ICS_ASDynamicCode Sub Invoke(EPTData As Dictionary(Of String, String)) Implements ContentStudio.Site.ActiveScripting.EPTBase If EPTData("Gender").ToUpper() = "M" Then Page.Response.Write(Page.Server.HtmlEncode(EPTData("Name")) & " is a male." Else Page.Response.Write(Page.Server.HtmlEncode(EPTData("Name")) & " is a female." End If End Sub End Class
Visual C#
CSF_LookUpField(CategoryId, LookUpFieldName, RetFieldName, LookUpValue, (UseApplicationCache), (ApplicationTimeOut));
Visual Basic.NET
CSF_LookUpField(CategoryId, LookUpFieldName, RetFieldName, LookUpValue, (UseApplicationCache), (ApplicationTimeOut))
See Also