Documentation > CMS Template API Library > UploadedFiles > WasCleared(String)
WasCleared
Returns true if the fields specified by key was cleared on the last edit. Only valid in post input. Returns false in all other contexts.
public System.Boolean WasCleared(String)
Returns
true or false
Parameters
Name | Description | Type |
---|---|---|
key | System.String |
Code Example
C#
Sample:
if(context.InputForm.UploadedFiles.WasCleared("main_image")); { //Clean up the associated fields }