Documentation > CMS Template API Library > InputForm

CrownPeak.CMSAPI.InputForm

A construct that allows you to read, edit, add, or remove form fields before they are commited to the Database.

NameDescriptionType
ClearUpload

Causes the specified upload's meta data to be removed from the asset when the asset is saved after post_input runs.

Method
CreateThumbnail

Creates a thumbnail of the specified size from the currently loaded image. A ThumbnailKey is required. The resulting image will be stored on the asset at the end of post_input. Note: Due to memory limitations, the pixel count of the source image cannot be more than 10 million.

Method
CreateThumbnail

Creates a thumbnail of the specified size from an uploaded files. A ThumbnailKey is required. The resulting image will be stored on the asset at the end of post_input. Note: Due to memory limitations, the pixel count of the source image cannot be more than 10 million.

Method
CropImage

Crop the given image as specified. Lasso Params not saved with this call.

Method
CropImage

Recommended Version: Crop the current image stored on the uploadedFile using the box defined on the input form using the lasso. "Lasso" properties must be set on ShowAcquireParams when they are passed to Input.ShowAcquireImage

Method
GetPanels

Get panels based on list name from data posted from the InputForm.

Method
GetPanelsFromFolder

Gets a List of AssetPanelEntry objects which bind panel data with Assets found in the folder provided. Panel data will be data in the inputform which has not yet been committed.

Method
GetPanelsFromFolder

The same as but with instead of .

Method
GetPanelsFromFolder

Gets a List of AssetPanelEntry objects which bind panel data with Assets found in either the current asset instance, if it a folder or the current asset's parent. Panel data will be data in the inputform which has not yet been committed.

Method
HasField

Use to see if a field with the given name is provided by the InputForm

Method
Remove

Add a collection of fieldsNames, that should be removed. This could be a List of strings or the Keys property from a dictionary object

Method
Remove

Overload for List

Method
Remove

Add the name of a field that should be removed.

Method
RemoveByPrefix

Add all fields starting with the prefix to the list of fields to be removed.

Method
SaveContent

Adds or edits form fields defined in the given dictionary. These fields will be committed after the post_input template file runs.

Method
SaveContentField

Adds or edits a form field before committing to the DB These fields will be committed after the post_input template file runs.

Method
SaveUploadedFile

Save an uploaded file with the given key

Method
Item[String]

Used to read or assign a value. If a null value is assigned, a blank string is stored.

Property
UploadedFiles

Upload paths that were changed on the previous edit

Property

Code Example

C#

Sample:
 
             
             
             // Gets the value of a form field called "title" that was posted from the input form (input.aspx)
             string newTitle = context.InputForm["title"];
             
             // Change data to be saved
             context.InputForm["title"] = "A new value to be saved as a content property called title on the current asset";
            
             // add a value to be saved
             context.InputForm["newfield"] = "A new field to be saved as a content property on the current asset";
            
            

Connect with Crownpeak