UploadControlFileUploadMode Enum
Lists values which specify when the file upload process is automatically executed on the server side.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v23.1.dll
NuGet Package: DevExpress.Web
Declaration
Members
Name | Description |
---|---|
BeforePageLoad
|
Specifies that the file upload process is automatically executed before Page_Load event. |
OnPageLoad
|
Specifies that the file upload process is automatically executed on Page_Load event. |
Related API Members
The following properties accept/return UploadControlFileUploadMode values:
Remarks
The UploadControlFileUploadMode enumerator lists the values used to set the ASPxUploadControl.FileUploadMode property. The property specifies the moment of a page life cycle when the file upload should be performed. Note that after a file is uploaded, the page’s life cycle processing is broken, so subsequent page events are not raised.
Set the FileUploadMode property to BeforePageLoad to perform a file upload before a page controls hierarchy is rebuilt. In this case, you can simply upload a file without request to other controls on the page.
Set the FileUploadMode property to OnPageLoad to perform a file upload after page a controls hierarchy is rebuilt. In this case, you can upload a file using additional information from other controls on the page.
The UploadControlFileUploadMode enumerator lists the values used to set the FileUploadMode property. The property specifies the moment of a page life cycle when the file upload should be performed. Note that after a file is uploaded, the page’s life cycle processing is broken, so subsequent page events are not raised.
Set the FileUploadMode property to BeforePageLoad to perform a file upload before a page controls hierarchy is rebuilt. In this case, you can simply upload a file without request to other controls on the page.
Set the FileUploadMode property to OnPageLoad to perform a file upload after page a controls hierarchy is rebuilt. In this case, you can upload a file using additional information from other controls on the page.
Example
This example demonstrates how ASPxUploadControl can get the information from other controls on the page in a file upload process (within FileUploadComplete event handler). Note that the 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;
e.UploadedFile.SaveAs(fileName);
}
Online Demo
ASPxUploadControl - Upload and Submit