ASPxUploadControl Class
A file upload control.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v19.2.dll
Declaration
public class ASPxUploadControl :
ASPxWebControl,
IAssociatedControlID,
ICallbackEventHandler
Public Class ASPxUploadControl
Inherits ASPxWebControl
Implements IAssociatedControlID,
ICallbackEventHandler
Remarks
The Upload Control can upload files with AJAX callbacks for improved responsiveness, offers built-in file validation support, and ships with an advanced client-side API.
Create an Upload Control
Design Time
The ASPxUploadControl control is available on the DX.19.2: Common Controls toolbox tab in the Microsoft Visual Studio IDE.
Drag the control onto a form and customize control settings, or paste the control markup in the page's source code.
<dx:ASPxUploadControl ID="ASPxUploadControl1" runat="server" UploadMode="Auto" ShowProgressPanel="True" ShowUploadButton="True">
<ValidationSettings AllowedFileExtensions=".jpg, .jpeg, .gif, .png" MaxFileSize="4194304">
</ValidationSettings>
<AdvancedModeSettings EnableDragAndDrop="True" EnableFileList="True" EnableMultiSelect="True">
</AdvancedModeSettings>
</dx:ASPxUploadControl>
Run Time
using DevExpress.Web;
...
protected void Page_Load(object sender, EventArgs e) {
ASPxUploadControl uploadControl = new ASPxUploadControl();
uploadControl.ID = "ASPxUploadControl1";
uploadControl.UploadMode = UploadControlUploadMode.Auto;
uploadControl.ShowProgressPanel = true;
uploadControl.ShowUploadButton = true;
uploadControl.AdvancedModeSettings.EnableDragAndDrop = true;
uploadControl.AdvancedModeSettings.EnableFileList = true;
uploadControl.AdvancedModeSettings.EnableMultiSelect = true;
uploadControl.ValidationSettings.AllowedFileExtensions = new String[] { ".jpg", ".jpeg", ".gif", ".png" };
uploadControl.ValidationSettings.MaxFileSize = 4194304;
uploadControl.FileUploadMode = UploadControlFileUploadMode.OnPageLoad;
// Add the created control to the page
Page.Form.Controls.Add(uploadControl);
}
Client-Side API
The ASPxUploadControl's client-side API is implemented with JavaScript language and exposed by the ASPxClientUploadControl object.
Availability | Available by default. |
Class name | |
Access name | |
Events |
Features
File Upload
The file upload starts when a user clicks the upload button or ASPxClientUploadControl.Upload method is called. Set the AutoStartUpload property to true to start file upload when a file is added to the upload control.
Upload Event | Description |
---|---|