Search Results for

Show / Hide Table of Contents

# Class AjaxAttachments

Attachment-style upload control for forms that need a compact file list with remove support.

##### Inheritance

object
Control
WebControl
AjaxAttachments
UploadAttachments

##### Implements

IComponent
IDisposable
IParserAccessor
IUrlResolutionService
IDataBindingsAccessor
IControlBuilderAccessor
IControlDesignerAccessor
IExpressionsAccessor
IAttributeAccessor
IPostBackDataHandler

##### Inherited Members

WebControl.AddAttributesToRender(HtmlTextWriter)
WebControl.ApplyStyle(Style)
WebControl.CopyBaseAttributes(WebControl)
WebControl.CreateControlStyle()
WebControl.LoadViewState(object)
WebControl.TrackViewState()
WebControl.MergeStyle(Style)
WebControl.RenderBeginTag(HtmlTextWriter)
WebControl.RenderEndTag(HtmlTextWriter)
WebControl.RenderContents(HtmlTextWriter)
WebControl.SaveViewState()
WebControl.AccessKey
WebControl.Attributes
WebControl.BackColor
WebControl.BorderColor
WebControl.BorderWidth
WebControl.BorderStyle
WebControl.ControlStyle
WebControl.ControlStyleCreated
WebControl.CssClass
WebControl.DisabledCssClass
WebControl.Style
WebControl.Enabled
WebControl.EnableTheming
WebControl.Font
WebControl.ForeColor
WebControl.HasAttributes
WebControl.Height
WebControl.IsEnabled
WebControl.SupportsDisabledAttribute
WebControl.SkinID
WebControl.TabIndex
WebControl.TagKey
WebControl.TagName
WebControl.ToolTip
WebControl.Width
Control.ResolveAdapter()
Control.HasEvents()
Control.GetRouteUrl(object)
Control.GetRouteUrl(string, object)
Control.GetRouteUrl(RouteValueDictionary)
Control.GetRouteUrl(string, RouteValueDictionary)
Control.GetUniqueIDRelativeTo(Control)
Control.ApplyStyleSheetSkin(Page)
Control.OnDataBinding(EventArgs)
Control.DataBind()
Control.DataBind(bool)
Control.DataBindChildren()
Control.AddParsedSubObject(object)
Control.EnsureID()
Control.OnInit(EventArgs)
Control.ClearChildState()
Control.ClearChildControlState()
Control.ClearChildViewState()
Control.ClearEffectiveClientIDMode()
Control.ClearCachedClientID()
Control.Focus()
Control.LoadControlState(object)
Control.MapPathSecure(string)
Control.OpenFile(string)
Control.OnLoad(EventArgs)
Control.BuildProfileTree(string, bool)
Control.SaveControlState()
Control.RenderChildren(HtmlTextWriter)
Control.RenderControl(HtmlTextWriter)
Control.RenderControl(HtmlTextWriter, ControlAdapter)
Control.OnUnload(EventArgs)
Control.Dispose()
Control.RaiseBubbleEvent(object, EventArgs)
Control.OnBubbleEvent(object, EventArgs)
Control.AddedControl(Control, int)
Control.CreateControlCollection()
Control.CreateChildControls()
Control.ResolveUrl(string)
Control.ResolveClientUrl(string)
Control.FindControl(string)
Control.FindControl(string, int)
Control.GetDesignModeState()
Control.HasControls()
Control.IsLiteralContent()
Control.EnsureChildControls()
Control.RemovedControl(Control)
Control.SetDesignModeState(IDictionary)
Control.SetRenderMethodDelegate(RenderMethod)
Control.ClientIDMode
Control.ClientID
Control.ClientIDSeparator
Control.Context
Control.Adapter
Control.DesignMode
Control.Events
Control.ID
Control.IsChildControlStateCleared
Control.EnableViewState
Control.ViewStateMode
Control.IsViewStateEnabled
Control.NamingContainer
Control.IdSeparator
Control.LoadViewStateByID
Control.Page
Control.RenderingCompatibility
Control.TemplateControl
Control.Parent
Control.TemplateSourceDirectory
Control.AppRelativeTemplateSourceDirectory
Control.Site
Control.Visible
Control.UniqueID
Control.HasChildViewState
Control.Controls
Control.ValidateRequestMode
Control.ViewState
Control.ViewStateIgnoresCase
Control.ChildControlsCreated
Control.IsTrackingViewState
Control.Disposed
Control.DataBinding
Control.Init
Control.Load
Control.PreRender
Control.Unload
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

###### Namespace: AjaxUploader.Controls

###### Assembly: AjaxUploader.dll

##### Syntax

    public class AjaxAttachments : WebControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IPostBackDataHandler

### Constructors

#### AjaxAttachments()

Initializes a new instance of the AjaxAttachments control.

##### Declaration

    public AjaxAttachments()

### Properties

#### ButtonText

Gets or sets the button text used to open the file picker.

##### Declaration

    public string ButtonText { get; set; }

##### Property Value

Type | Description
--- | ---
string |

#### Extensions

Gets or sets the allowed file extensions as a comma-separated list.

##### Declaration

    public string Extensions { get; set; }

##### Property Value

Type | Description
--- | ---
string |

#### MaxFiles

Gets or sets the maximum number of files that can be attached through the control.

##### Declaration

    public int MaxFiles { get; set; }

##### Property Value

Type | Description
--- | ---
int |

#### MaxSize

Gets or sets the maximum allowed file size.

##### Declaration

    public string MaxSize { get; set; }

##### Property Value

Type | Description
--- | ---
string |

#### OnClientChange

Gets or sets the JavaScript callback invoked when the attachment list changes. The callback receives the client attachment state after uploads, removals, or other list updates.

##### Declaration

    public string OnClientChange { get; set; }

##### Property Value

Type | Description
--- | ---
string |

#### Removable

Gets or sets whether attached files can be removed from the client list.

##### Declaration

    public bool Removable { get; set; }

##### Property Value

Type | Description
--- | ---
bool |

#### ShowSize

Gets or sets whether file sizes are shown in the attachment list.

##### Declaration

    public bool ShowSize { get; set; }

##### Property Value

Type | Description
--- | ---
bool |

#### UploadUrl

Gets or sets a custom upload endpoint for attachment uploads. When left empty, the standard AjaxUploader handler upload endpoint is used.

##### Declaration

    public string UploadUrl { get; set; }

##### Property Value

Type | Description
--- | ---
string |

#### UploadedFileGuids

Gets the uploaded file GUIDs restored from postback data. Use this list during page processing to associate attached files with the surrounding form data.

##### Declaration

    [Browsable(false)]
    public List<Guid> UploadedFileGuids { get; }

##### Property Value

Type | Description
--- | ---
List<Guid> |

### Methods

#### LoadPostData(string, NameValueCollection)

Loads the hidden attachment GUID list from postback data. The values are written by the client attachment widget into the hidden field rendered by the control.

##### Declaration

    public virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection)

##### Parameters

Type | Name | Description
--- | --- | ---
string | postDataKey |
NameValueCollection | postCollection |

##### Returns

Type | Description
--- | ---
bool |

#### OnPreRender(EventArgs)

Raises the PreRender event.

##### Declaration

    protected override void OnPreRender(EventArgs e)

##### Parameters

Type | Name | Description
--- | --- | ---
EventArgs | e | An EventArgs object that contains the event data.

##### Overrides

Control.OnPreRender(EventArgs)

#### RaisePostDataChangedEvent()

Raises post-data changed notifications for the attachment control. This implementation is intentionally empty; inspect UploadedFileGuids during page processing.

##### Declaration

    public virtual void RaisePostDataChangedEvent()

#### Render(HtmlTextWriter)

Renders the control to the specified HTML writer.

##### Declaration

    protected override void Render(HtmlTextWriter writer)

##### Parameters

Type | Name | Description
--- | --- | ---
HtmlTextWriter | writer | The HtmlTextWriter object that receives the control content.

##### Overrides

WebControl.Render(HtmlTextWriter)

### Implements

IComponent
IDisposable
IParserAccessor
IUrlResolutionService
IDataBindingsAccessor
IControlBuilderAccessor
IControlDesignerAccessor
IExpressionsAccessor
IAttributeAccessor
IPostBackDataHandler