Skip to main content

ASPxUploadControl.FileUploadMode Property

Gets or sets a value that specifies when the file upload should be performed.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.1.dll

NuGet Package: DevExpress.Web


public UploadControlFileUploadMode FileUploadMode { get; set; }

Property Value

Type Default Description
UploadControlFileUploadMode BeforePageLoad

One of the UploadControlFileUploadMode enumeration values.

Available values:

Name Description

Specifies that the file upload process is automatically executed before Page_Load event.


Specifies that the file upload process is automatically executed on Page_Load event.


The FileUploadMode property controls whether the file upload is performed on the server side, either during a server Page_Load event (the UploadControlFileUploadMode.OnPageLoad value), or before a server Page_Load event ( the UploadControlFileUploadMode.BeforePageLoad value).


When the FileUploadMode property is set to the default BeforePageLoad value, a file is uploaded and the request execution is aborted before the Page_Init method is called. Thus, controls are not initialized and not available in file upload events. Set the FileUploadMode property to OnPageLoad to rebuild the page hierarchy before the ASPxUploadControl requires them. In this case, control properties are available in file upload events.


This example demonstrates how ASPxUploadControl can get the information from other controls on the page in a file upload process (within ASPxUploadControl.FileUploadComplete event handler). Note that the ASPxUploadControl.FileUploadMode property must be set to OnPageLoad. In this case, a page hierarchy is rebuilt and control properties are available before the ASPxUploadControl requires them.

protected void ASPxUploadControl1_FileUploadComplete(object sender, DevExpress.Web.FileUploadCompleteEventArgs e) {
        string fileName = "D:/" + ASPxRadioButtonList1.Value + "/" + e.UploadedFile.FileName;
See Also