Documentation > CMS Template API Library > Asset > SaveContentField(String,String)

SaveContentField

Saves a content field to the database. If the value is null, it will be stored as an empty string.

public System.Void SaveContentField(String,String)

Parameters

NameDescriptionType
key The key. System.String
value The value. System.String

Code Example

C#

Sample:
string key = "MyCustomProperty";
string value = "Green";
asset.SaveContentField(key, value);
             

Connect with Crownpeak