Class UploadAttachments
Legacy attachment-list control compatibility wrapper built on top of AjaxAttachments.
Inheritance
UploadAttachments
Assembly: AjaxUploader.dll
Syntax
public class UploadAttachments : AjaxAttachments, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IPostBackDataHandler
Constructors
UploadAttachments()
Declaration
public UploadAttachments()
Properties
Declaration
public AttachmentItemBehavior ActionButtonBehavior { get; set; }
Property Value
ActionButtonText
Declaration
public string ActionButtonText { get; set; }
Property Value
Declaration
public string ActionHeaderText { get; set; }
Property Value
AttachmentTRStyle
Declaration
public string AttachmentTRStyle { get; set; }
Property Value
AttachmentTableStyle
Declaration
public string AttachmentTableStyle { get; set; }
Property Value
AutoPostBack
Gets or sets whether the control posts back automatically when the
upload batch finishes, raising AttachmentAdded and the
legacy FileUploaded event without a submit button. Defaults to
true to match the v4 (CuteWebUI) behaviour that
upgraded pages depend on; set false to require an explicit
postback (e.g. when a normal submit button drives the form).
Declaration
public bool AutoPostBack { get; set; }
Property Value
AutoUseSystemTempFolder
Gets or sets whether the system temp folder is used automatically.
Declaration
public bool AutoUseSystemTempFolder { get; set; }
Property Value
Gets or sets the script executed when the browse button is clicked.
Declaration
public string ButtonOnClickScript { get; set; }
Property Value
CancelAllMsg
Gets or sets the cancel-all prompt text.
Declaration
public string CancelAllMsg { get; set; }
Property Value
Gets the underlying legacy cancel button control.
Declaration
[Browsable(false)]
public Button CancelButton { get; }
Property Value
Gets or sets the ID of an existing element used as the cancel button.
Declaration
public string CancelButtonID { get; set; }
Property Value
Gets the style applied to the cancel button.
Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public Style CancelButtonStyle { get; }
Property Value
CancelText
Gets or sets the cancel button caption.
Declaration
public string CancelText { get; set; }
Property Value
CancelUploadMsg
Gets or sets the cancel-upload prompt text.
Declaration
public string CancelUploadMsg { get; set; }
Property Value
CustomProvider
Gets or sets a custom provider used to surface externally managed attachments.
Declaration
public IAttachmentProvider CustomProvider { get; set; }
Property Value
DialogAccept
Gets or sets the file-dialog accept list.
Declaration
public string DialogAccept { get; set; }
Property Value
DialogFilter
Gets or sets the legacy file-dialog filter.
Declaration
public string DialogFilter { get; set; }
Property Value
DirtyText
Gets or sets the marker text used by legacy item templates for unsaved changes.
Declaration
public string DirtyText { get; set; }
Property Value
DropZoneID
Declaration
public string DropZoneID { get; set; }
Property Value
Gets or sets the message shown when a file exceeds the size limit.
Declaration
public string FileTooLargeMsg { get; set; }
Property Value
FileTypeNotSupportMsg
Gets or sets the message shown for a disallowed file type.
Declaration
public string FileTypeNotSupportMsg { get; set; }
Property Value
FlashLoadMode
Gets or sets whether the legacy Flash transport is loaded.
Declaration
public bool FlashLoadMode { get; set; }
Property Value
FlashUploadPage
Gets or sets the legacy Flash upload page URL.
Declaration
public string FlashUploadPage { get; set; }
Property Value
FlashWarningImage
Gets or sets the legacy Flash warning image URL.
Declaration
public string FlashWarningImage { get; set; }
Property Value
Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public TableItemStyle HeaderRowStyle { get; }
Property Value
HideNoItemTable
Declaration
public bool HideNoItemTable { get; set; }
Property Value
InputboxCSSText
Gets or sets inline CSS applied to the legacy file input box.
Declaration
public string InputboxCSSText { get; set; }
Property Value
Gets the underlying legacy browse button control.
Declaration
[Browsable(false)]
public Button InsertButton { get; }
Property Value
Gets or sets the ID of an existing element used as the browse button.
Declaration
public string InsertButtonID { get; set; }
Property Value
Gets the style applied to the legacy browse button.
Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public Style InsertButtonStyle { get; }
Property Value
InsertText
Gets or sets the caption of the legacy attachment browse button.
Declaration
public string InsertText { get; set; }
Property Value
ItemCellStyle
Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public TableItemStyle ItemCellStyle { get; }
Property Value
ItemCheckStyle
Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public Style ItemCheckStyle { get; }
Property Value
ItemLabelStyle
Gets the style applied to the legacy item label.
Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public Style ItemLabelStyle { get; }
Property Value
ItemTemplate
Gets or sets the custom template used to render legacy attachment items.
Declaration
[TemplateContainer(typeof(AttachmentItem))]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate ItemTemplate { get; set; }
Property Value
ItemTemplatePosition
Declaration
public AttachmentItemTemplatePosition ItemTemplatePosition { get; set; }
Property Value
ItemTextTemplate
Gets or sets the legacy item text template.
Declaration
public string ItemTextTemplate { get; set; }
Property Value
Items
Gets the legacy attachment item collection.
Declaration
[Browsable(false)]
public AttachmentItemCollection Items { get; }
Property Value
ManualStartUpload
Declaration
public bool ManualStartUpload { get; set; }
Property Value
MaxFilesLimit
Gets or sets the maximum number of files accepted in one batch.
Declaration
public int MaxFilesLimit { get; set; }
Property Value
MaxFilesLimitMsg
Gets or sets the message shown when the file-count limit is exceeded.
Declaration
public string MaxFilesLimitMsg { get; set; }
Property Value
MultipleFilesUpload
Declaration
public bool MultipleFilesUpload { get; set; }
Property Value
NumFilesShowCancelAll
Gets or sets the number of queued files at which the cancel-all control appears.
Declaration
public int NumFilesShowCancelAll { get; set; }
Property Value
NumFilesShowQueueUI
Gets or sets the number of queued files at which the queue UI appears.
Declaration
public int NumFilesShowQueueUI { get; set; }
Property Value
ProgressBarBackgroundImage
Gets or sets the progress bar background image URL.
Declaration
public string ProgressBarBackgroundImage { get; set; }
Property Value
ProgressBarBorderStyle
Gets or sets the progress bar border style.
Declaration
public string ProgressBarBorderStyle { get; set; }
Property Value
ProgressBarColor
Gets or sets the progress bar fill colour.
Declaration
public string ProgressBarColor { get; set; }
Property Value
ProgressBarHeight
Gets or sets the progress bar height in pixels.
Declaration
public int ProgressBarHeight { get; set; }
Property Value
ProgressBarStyle
Gets or sets the progress bar rendering style.
Declaration
public ProgressBarType ProgressBarStyle { get; set; }
Property Value
ProgressCtrlID
Gets or sets the ID of an existing element used as the progress control.
Declaration
public string ProgressCtrlID { get; set; }
Property Value
ProgressInfoStyle
Gets or sets inline CSS applied to the progress info text.
Declaration
public string ProgressInfoStyle { get; set; }
Property Value
ProgressLabel
Gets the label used for legacy progress text.
Declaration
[Browsable(false)]
public Label ProgressLabel { get; }
Property Value
ProgressLabelStyle
Gets the style applied to the progress label.
Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public Style ProgressLabelStyle { get; }
Property Value
ProgressPanel
Gets the container used for legacy progress UI.
Declaration
[Browsable(false)]
public Panel ProgressPanel { get; }
Property Value
ProgressPanelStyle
Gets the style applied to the progress panel.
Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public Style ProgressPanelStyle { get; }
Property Value
ProgressPanelWidth
Gets or sets the progress panel width in pixels.
Declaration
public int ProgressPanelWidth { get; set; }
Property Value
ProgressPicture
Gets or sets the animated progress image URL.
Declaration
public string ProgressPicture { get; set; }
Property Value
ProgressTextID
Gets or sets the ID of an existing element used for progress text.
Declaration
public string ProgressTextID { get; set; }
Property Value
ProgressTextTemplate
Gets or sets the progress text template.
Declaration
public string ProgressTextTemplate { get; set; }
Property Value
QueuePanelID
Gets or sets the ID of an existing element used as the queue panel.
Declaration
public string QueuePanelID { get; set; }
Property Value
Declaration
public AttachmentItemBehavior RemoveButtonBehavior { get; set; }
Property Value
RemoveButtonText
Declaration
public string RemoveButtonText { get; set; }
Property Value
Declaration
public string RemoveHeaderText { get; set; }
Property Value
Declaration
public bool ShowActionButtons { get; set; }
Property Value
ShowCheckBoxes
Declaration
public bool ShowCheckBoxes { get; set; }
Property Value
ShowFileIcons
Declaration
public bool ShowFileIcons { get; set; }
Property Value
Gets or sets whether the frame-based browse button is shown.
Declaration
public bool ShowFrameBrowseButton { get; set; }
Property Value
ShowProgressBar
Gets or sets whether the progress bar is shown.
Declaration
public bool ShowProgressBar { get; set; }
Property Value
ShowProgressInfo
Gets or sets whether progress text is shown.
Declaration
public bool ShowProgressInfo { get; set; }
Property Value
ShowQueueTable
Declaration
public bool ShowQueueTable { get; set; }
Property Value
Declaration
public bool ShowRemoveButtons { get; set; }
Property Value
ShowRemoveButtonsAsText
Declaration
public bool ShowRemoveButtonsAsText { get; set; }
Property Value
Declaration
public bool ShowTableHeader { get; set; }
Property Value
Declaration
public string TableHeaderTemplate { get; set; }
Property Value
TableStyle
Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public TableStyle TableStyle { get; }
Property Value
TempDirectory
Gets or sets the temporary upload directory.
Declaration
public string TempDirectory { get; set; }
Property Value
Declaration
public string TemplateHeaderText { get; set; }
Property Value
Gets or sets the add-on button image URL.
Declaration
public string UploadAddonButtonImage { get; set; }
Property Value
Gets or sets the add-on button mode.
Declaration
public UploadAddonButtonMode UploadAddonButtonMode { get; set; }
Property Value
UploadAddonButtonShowText
Gets or sets whether the add-on button shows its text.
Declaration
public bool UploadAddonButtonShowText { get; set; }
Property Value
UploadAddonWarningImage
Gets or sets the add-on warning image URL.
Declaration
public string UploadAddonWarningImage { get; set; }
Property Value
UploadCursor
Gets or sets the mouse cursor shown over the browse button.
Declaration
public UploadCursor UploadCursor { get; set; }
Property Value
UploadProcessingMsg
Gets or sets the server-side processing message.
Declaration
public string UploadProcessingMsg { get; set; }
Property Value
UploadType
Declaration
public UploadType UploadType { get; set; }
Property Value
UploadTypePriority
Gets or sets the preferred upload transport order.
Declaration
public string UploadTypePriority { get; set; }
Property Value
UploaderDebug
Gets or sets the legacy debug flag.
Declaration
public string UploaderDebug { get; set; }
Property Value
UploadingMsg
Gets or sets the in-progress message.
Declaration
public string UploadingMsg { get; set; }
Property Value
ValidateOption
Gets the legacy attachment validation settings.
Declaration
[PersistenceMode(PersistenceMode.InnerProperty)]
public UploaderValidateOption ValidateOption { get; }
Property Value
WindowsDialogLimitMsg
Gets or sets the Windows file-dialog limit message.
Declaration
public string WindowsDialogLimitMsg { get; set; }
Property Value
Methods
AddCustomAttachment(Guid)
Declaration
public void AddCustomAttachment(Guid fileguid)
Parameters
| Type |
Name |
Description |
| Guid |
fileguid |
|
CheckPostBackData()
v3/v4 parity: forces the control to process its posted GUID list if ASP.NET has not
already done so. In v4 this was the documented escape hatch for pages where the
automatic post-data path did not run.
Declaration
public void CheckPostBackData()
DeleteAllAttachments()
Deletes every attachment in the current collection.
Declaration
public void DeleteAllAttachments()
DeleteAttachment(int)
Deletes the attachment at the specified index.
Declaration
public void DeleteAttachment(int index)
Parameters
| Type |
Name |
Description |
| int |
index |
|
DeleteUncheckedAttachments()
Deletes all unchecked attachments.
Declaration
public void DeleteUncheckedAttachments()
GetAdvancedOption(UploaderAdvancedOption)
Returns the stored value for a legacy advanced option flag.
Declaration
public string GetAdvancedOption(UploaderAdvancedOption name)
Parameters
Returns
GetAttachmentCount()
Returns the number of currently visible attachment items.
Declaration
public int GetAttachmentCount()
Returns
GetBrowserType()
Gets the current browser name from the active HTTP request.
Declaration
public string GetBrowserType()
Returns
GetBrowserVersion()
Gets the current browser version from the active HTTP request.
Declaration
public decimal GetBrowserVersion()
Returns
GetItemsTable()
Gets the internal table-like container used by the legacy control.
Declaration
public WebControl GetItemsTable()
Returns
GetTempDirectory()
Gets the resolved temporary upload directory.
Declaration
public string GetTempDirectory()
Returns
GetUploadedFile(Guid)
Resolves an uploaded file by GUID and wraps it in the legacy MVC helper type.
Declaration
public MvcUploadFile GetUploadedFile(Guid guid)
Parameters
| Type |
Name |
Description |
| Guid |
guid |
|
Returns
GetUploaderProvider()
Creates a legacy provider wrapper for accessing uploaded files.
Declaration
public UploaderProvider GetUploaderProvider()
Returns
Impersonate()
Returns a disposable impersonation scope placeholder kept for compatibility.
Declaration
public IDisposable Impersonate()
Returns
OnAttachmentActionClicked(AttachmentItemEventArgs)
Declaration
protected virtual void OnAttachmentActionClicked(AttachmentItemEventArgs args)
Parameters
OnAttachmentAdded(AttachmentItemEventArgs)
Declaration
protected virtual void OnAttachmentAdded(AttachmentItemEventArgs args)
Parameters
OnAttachmentCheckChanged(AttachmentItemEventArgs)
Declaration
protected virtual void OnAttachmentCheckChanged(AttachmentItemEventArgs args)
Parameters
OnAttachmentCreated(AttachmentItemEventArgs)
Declaration
protected virtual void OnAttachmentCreated(AttachmentItemEventArgs args)
Parameters
OnAttachmentDataBound(AttachmentItemEventArgs)
Declaration
protected virtual void OnAttachmentDataBound(AttachmentItemEventArgs args)
Parameters
OnAttachmentHided(AttachmentItemEventArgs)
Declaration
protected virtual void OnAttachmentHided(AttachmentItemEventArgs args)
Parameters
OnAttachmentRemoveClicked(AttachmentItemEventArgs)
Declaration
protected virtual void OnAttachmentRemoveClicked(AttachmentItemEventArgs args)
Parameters
OnFileUploaded(UploaderEventArgs)
Declaration
protected virtual void OnFileUploaded(UploaderEventArgs args)
Parameters
OnFileValidating(UploaderEventArgs)
Declaration
protected virtual void OnFileValidating(UploaderEventArgs args)
Parameters
OnPreRender(EventArgs)
Declaration
protected override void OnPreRender(EventArgs e)
Parameters
Overrides
OnUploadCompleted(UploaderEventArgs[])
Declaration
protected virtual void OnUploadCompleted(UploaderEventArgs[] args)
Parameters
RaisePostDataChangedEvent()
Raises post-data changed notifications for the attachment control.
This implementation is intentionally empty; inspect UploadedFileGuids during page processing.
Declaration
public override void RaisePostDataChangedEvent()
Overrides
Render(HtmlTextWriter)
Renders the control to the specified HTML writer.
Declaration
protected override void Render(HtmlTextWriter writer)
Parameters
Overrides
SetAdvancedOption(UploaderAdvancedOption, string)
Stores a legacy advanced option flag value.
Declaration
public void SetAdvancedOption(UploaderAdvancedOption name, string value)
Parameters
SetValidationServerData(string)
Stores opaque validation data round-tripped by legacy pages.
Declaration
public void SetValidationServerData(string data)
Parameters
| Type |
Name |
Description |
| string |
data |
|
Upload(int, string, Stream)
Declaration
public void Upload(int filesize, string filename, Stream stream)
Parameters
Upload(int, string, string)
Declaration
public void Upload(int filesize, string filename, string temppath)
Parameters
Events
AttachmentActionClicked
Occurs when the action button is clicked for an attachment item.
Declaration
public event AttachmentItemEventHandler AttachmentActionClicked
Event Type
AttachmentAdded
Occurs when an attachment item is added to the collection.
Declaration
public event AttachmentItemEventHandler AttachmentAdded
Event Type
AttachmentCheckChanged
Occurs when an attachment item's checked state changes.
Declaration
public event AttachmentItemEventHandler AttachmentCheckChanged
Event Type
AttachmentCreated
Occurs when an attachment item object is created.
Declaration
public event AttachmentItemEventHandler AttachmentCreated
Event Type
AttachmentDataBound
Occurs when an attachment item is data-bound.
Declaration
public event AttachmentItemEventHandler AttachmentDataBound
Event Type
AttachmentHided
Occurs when an attachment item is hidden.
Declaration
public event AttachmentItemEventHandler AttachmentHided
Event Type
AttachmentRemoveClicked
Occurs when the remove action is triggered for an attachment item.
Declaration
public event AttachmentItemEventHandler AttachmentRemoveClicked
Event Type
FileUploaded
Occurs after a file is uploaded into the attachment list.
Declaration
public event UploaderEventHandler FileUploaded
Event Type
FileValidating
Occurs before an uploaded file is accepted into the attachment list. v4 raised this
for every file so pages could reject one by throwing from the handler.
Declaration
public event UploaderEventHandler FileValidating
Event Type
UploadCompleted
Occurs once after the current batch of uploaded files has been processed.
Declaration
public event UploaderBatchEventHandler UploadCompleted
Event Type
Implements