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

SaveMetaField

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

public System.Void SaveMetaField(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.SaveMetaField(key, value);
             

Connect with Crownpeak