UserControlBaseCS_DataFields Property Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Gets a EPTXmlParser that contains a collection of EPT field definitions and values. This property is the replacement for the obsolete EPT_GetFieldName(String) and EPT_GetFieldValue(String) methods.

Namespace: ContentStudio.Site
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public EPTXmlParser CS_DataFields { get; }

Property Value

Type: EPTXmlParser
A EPTXmlParser when called from a Presentation template; null (Nothing in Visual Basic) otherwise.
Remarks

Important!
Always check for null (Nothing in Visual Basic) values when working with this property or use thoroughly implemented exception handling.
Examples

This code example shows how to get the value of an EPT field named "Header". This code only works in a Presentation Template.

C#
try
{
  Response.Write(Server.HtmlEncode("Fieldvalue: " + CS_DataFields["Header"]));
}
catch (ContentStudio.CSException ex)
{
  Response.Write("<b>" + Server.HtmlEncode(CS_TranslateMessage(ex)) + "</b>");
}
catch (Exception ex)
{
  Response.Write("<b>" + Server.HtmlEncode(ex.Message) + "</b>");
}
Visual Basic
Try
  Response.Write(Server.HtmlEncode("Fieldvalue: " & CS_DataFields("Header")))
Catch ex As ContentStudio.CSException
  Response.Write("<b>" + Server.HtmlEncode(CS_TranslateMessage(ex)) + "</b>")
Catch ex As Exception
  Response.Write("<b>" + Server.HtmlEncode(ex.Message) + "</b>")
End Try
See Also

Reference