UploadTagHelper
Kendo UI Upload TagHelper UploadTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-upload")]
[HtmlTargetElement("upload-editor", TagStructure = TagStructure.NormalOrSelfClosing, ParentTag = "form-item")]
[RestrictChildren("async", new string[] { "files", "localization", "validation", "item-template" })]
[OutputElementHint("div")]
public class UploadTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, ITemplateComponent, IKendoFormEditor
Inheritance: objectTagHelperTagHelperBaseUploadTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-upload name="upload">
<async save-url="https://example.com/save" remove-url="https://example.com/remove" />
</kendo-upload>
Child Tags
Constructors
Initializes a new instance of the UploadTagHelper class.
Properties
Enables the selection of folders instead of files. When the user selects a directory, its entire content hierarchy of files is included in the set of selected items. The directory setting is available only in browsers which support webkitdirectory.
public bool? Directory { get; set; }
Enables the dropping of folders over the Upload and its drop zone. When a directory is dropped, its entire content hierarchy of files is included in the set of selected items. The directoryDrop setting is available only in browsers which support DataTransferItem and webkitGetAsEntry.
public bool? DirectoryDrop { get; set; }
Initializes a drop-zone element based on a given selector, which provides the drag-and-drop file upload.
public string DropZone { get; set; }
Enables (if set to true) or disables (if set to false) an Upload. To re-enable a disabled Upload, use enable().
public bool? Enabled { get; set; }
Enables (if set to true) or disables (if set to false) the selection of multiple files. If set to false, the user can select only one file at a time.
public bool? Multiple { get; set; }
The name of the JavaScript function that will handle the cancel event. Fires when the upload was cancelled while in progress.
public string OnCancel { get; set; }
The name of the JavaScript function that will handle the clear event. Fires when the files are cleared by clicking on the Clear button.
public string OnClear { get; set; }
The name of the JavaScript function that will handle the complete event. Fires when all active uploads complete—either successfully or with errors.
public string OnComplete { get; set; }
The name of the JavaScript function that will handle the error event. Fires when an upload or remove operation fails.
public string OnError { get; set; }
The name of the JavaScript function that will handle the pause event. Fires when the files are cleared by clicking the Pause button. The button is visible if chunksize is set.
public string OnPause { get; set; }
The name of the JavaScript function that will handle the progress event. Fires when the data about the progress of the upload is available.
public string OnProgress { get; set; }
The name of the JavaScript function that will handle the remove event. Fires when an uploaded file is about to be removed. If the event is canceled, the remove operation is prevented.
public string OnRemove { get; set; }
The name of the JavaScript function that will handle the resume event. Fires when the files are resumed through clicking the Resume button. The button is visible if chunksize is set and the file upload is paused.
public string OnResume { get; set; }
The name of the JavaScript function that will handle the select event. Fires when a file is selected.
public string OnSelect { get; set; }
The name of the JavaScript function that will handle the success event. Fires when an upload or remove operation is completed successfully.
public string OnSuccess { get; set; }
The name of the JavaScript function that will handle the upload event. Fires when one or more files are about to be uploaded. The canceling of the event prevents the upload.
public string OnUpload { get; set; }
Enables (if set to true) or disables (if set to false) the display of a file listing for the file upload. The disabling of a file listing might be useful if you want to customize the UI. To build your own UI, use the client-side events.
public bool? ShowFileList { get; set; }
Sets a template for rendering the files in the file list.The template data Array consists of: name - The name of the file. If in batch upload mode, represents a string combination of all file names separated with comma.; size - The file size in bytes. If in batch upload mode, represents the total file size. If not available, the value is null. or files - An array which contains information about all selected files (name, size, and extension)..
public string Template { get; set; }
Sets a template for rendering the files in the file list.The template data Array consists of: name - The name of the file. If in batch upload mode, represents a string combination of all file names separated with comma.; size - The file size in bytes. If in batch upload mode, represents the total file size. If not available, the value is null. or files - An array which contains information about all selected files (name, size, and extension).. This option expects the name of a JavaScript function that will be called to return the template.
public string TemplateHandler { get; set; }
Sets a template for rendering the files in the file list.The template data Array consists of: name - The name of the file. If in batch upload mode, represents a string combination of all file names separated with comma.; size - The file size in bytes. If in batch upload mode, represents the total file size. If not available, the value is null. or files - An array which contains information about all selected files (name, size, and extension).. This option expects the ID of the script element that contains the template.
public string TemplateId { get; set; }
Represents a collection of templates defined for the component.
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }
Implements:
Sets a template for rendering the files in the file list.The template data Array consists of: name - The name of the file. If in batch upload mode, represents a string combination of all file names separated with comma.; size - The file size in bytes. If in batch upload mode, represents the total file size. If not available, the value is null. or files - An array which contains information about all selected files (name, size, and extension).. This option expects the IHtmlContent instance containing the created HTML.
public IHtmlContent TemplateView { get; set; }
Methods
Gets the initialization script.
protected override string GetInitializationScript()
The initialization script.
Overrides:
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Overrides:
Serializes the defined settings.
public override IDictionary<string, object> Serialize()
Overrides:
SerializeEvents method.
protected override Dictionary<string, object> SerializeEvents()
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
TryAddAsEditor method.
public bool TryAddAsEditor(TagHelperContext context)
The result.
Implements:
Writes the HTML output.
protected override void WriteHtml(TagHelperOutput output)
The TagHelper output.
Overrides: