Table of Contents

Class MediaFilesSelector

Namespace
Kentico.Components.Web.Mvc.FormComponents
Assembly
Kentico.Content.Web.Mvc.dll

Represents media files selector.

public class MediaFilesSelector : FormComponent<MediaFilesSelectorProperties, IEnumerable<MediaFilesSelectorItem>>
Inheritance
object
MediaFilesSelector
Inherited Members
Extension Methods

Fields

IDENTIFIER

Represents the MediaFilesSelector identifier.

public const string IDENTIFIER = "Kentico.MediaFilesSelector"

Field Value

string

Properties

AllowedExtensions

Gets allowed extensions for the selector.

public string AllowedExtensions { get; }

Property Value

string

Remarks

If the AllowedExtensions property value is not provided, 'Media file allowed extensions' site settings key value is used.

FilesData

Gets serialized model of selected files.

public string FilesData { get; }

Property Value

string

Value

Represents the value in the resulting HTML.

public string Value { get; set; }

Property Value

string

Methods

BindContext(FormComponentContext)

Binds contextual information to the form component.

public override void BindContext(FormComponentContext context)

Parameters

context FormComponentContext

Form component context.

GetValue()

Returns collection of selected media files.

public override IEnumerable<MediaFilesSelectorItem> GetValue()

Returns

IEnumerable<MediaFilesSelectorItem>

SetValue(IEnumerable<MediaFilesSelectorItem>)

Sets selected media files to the selector.

public override void SetValue(IEnumerable<MediaFilesSelectorItem> value)

Parameters

value IEnumerable<MediaFilesSelectorItem>

Validate(ValidationContext)

Validates whether selected media file is valid.

public override IEnumerable<ValidationResult> Validate(ValidationContext validationContext)

Parameters

validationContext ValidationContext

Returns

IEnumerable<ValidationResult>