Back to Devexpress

ASPxUploadControl.ShowProgressPanel Property

aspnet-devexpress-dot-web-dot-aspxuploadcontrol-fe57756f.md

latest7.0 KB
Original Source

ASPxUploadControl.ShowProgressPanel Property

Specifies the progress panel visibility.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(false)]
public bool ShowProgressPanel { get; set; }
vb
<DefaultValue(False)>
Public Property ShowProgressPanel As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true, if the progress panel is visible; otherwise, false.

|

Remarks

Use the ShowProgressPanel property to specify whether the progress panel (which contains the progress bar and cancel button) is visible within the ASPxUploadControl.

The appearance of the progress bar element and the cancel button are customized by using the ASPxUploadControl.ProgressBarStyle, ASPxUploadControl.ProgressBarIndicatorStyle and the ASPxUploadControl.ButtonStyle properties. The image and text for the cancel button are defined via the ASPxUploadControl.CancelButton property. The cancel button ‘s layout can be customized using the ASPxUploadControl.CancelButtonHorizontalPosition and ASPxUploadControl.CancelButtonSpacing properties.

Note

The ASPxUploadProgressHttpHandler is required for the ASPxUploadControl‘s progress panel to function properly. This handler is automatically added to a web project’s Web.Config file when setting the ShowProgressPanel property to true within the ASPxUploadControl ‘s smart tag. If you enable the ShowProgressPanel property via code, you should manually register the ASPxUploadProgressHttpHandler within the Web.Config file.

Note

If you are experiencing the “Access is denied” or “Permission Denied” error during large file uploads to the IIS 5.x or Cassini Web Server, we recommend that you execute the following command at the server, to work around the problem:

%windir%\system32\inetsrv\appcmd.exe set config -section:system.webServer/security/requestFiltering -requestLimits.maxAllowedContentLength: <new-request-length>

Here, <new-request-length> is the new, larger value of the request length.

Note

The maximum size of the file that can be uploaded using ASPxUploadControl in the standard upload mode with progress enabled is about 633MB. To learn more, see the Uploading Large Files topic.

Example

This sample demonstrates how to use the ASPxUploadControl , and how to pass a file name that was saved on the server to the client, by using the server-side and client-side FileUploadComplete events.

javascript
function OnUploadStart() {
         btnUpload.SetText("Uploading...");
         btnUpload.SetEnabled(false);
     }
     function OnUploadComplete(args) {
         btnUpload.SetText("Upload");
         btnUpload.SetEnabled(true);
         lblFileName.SetText(args.callbackData);
     }
aspx
<script runat="server">
    protected void Page_Load(object sender, EventArgs e) {

    }
    protected void ASPxUploadControl1_FileUploadComplete(object sender, 
       DevExpress.Web.FileUploadCompleteEventArgs e) {
        string fileName = e.UploadedFile.FileName;
        e.CallbackData = fileName;
    }
 </script>

 <html xmlns="http://www.w3.org/1999/xhtml" >
 <head id="Head1" runat="server">
     <title>How to pass a file name that was saved on the server to the client</title> 
</head>
 <body>
     <form id="form2" runat="server">

         <div>
             <dxuc:ASPxUploadControl ID="ASPxUploadControl1" runat="server" 
                 ClientInstanceName="upload" 
                 OnFileUploadComplete="ASPxUploadControl1_FileUploadComplete" 
                 ShowProgressPanel="True" ShowUploadButton="True" 
                 Size="25">
                 <ProgressBarIndicatorStyle BackColor="#0099CC">
                 </ProgressBarIndicatorStyle>
                 <ProgressBarSettings ShowPosition="False" />
                 <ClientSideEvents FileUploadComplete="function(s, e) { OnUploadComplete(e); }" 
                 FileUploadStart="function(s, e) { OnUploadStart(); }" />
                 <ProgressBarStyle BackColor="#99CCFF">
                 </ProgressBarStyle>
             </dxuc:ASPxUploadControl>
             <dxe:ASPxButton ID="btnUpload" runat="server" AutoPostBack="False" 
                  Text="Upload" ClientInstanceName="btnUpload">
                 <ClientSideEvents Click="function(s, e) { upload.UploadFile(); }">
                 </ClientSideEvents>
             </dxe:ASPxButton>
             
            
             <table cellpadding="0" cellspacing="0">
                 <tr>
                     <td style="padding-right: 5px;">
                         <dxe:ASPxLabel ID="lblUploadedFileName" runat="server" 
                         Text="Uploaded file name: " Font-Bold="True">
                         </dxe:ASPxLabel>                    
                     </td>                    
                     <td>
                         <dxe:ASPxLabel ID="lblFileName" runat="server" 
                          ClientInstanceName="lblFileName">
                         </dxe:ASPxLabel>                    
                     </td>                    
                 </tr>
             </table>            
         </div>
     </form>
 </body>
 </html>

See Also

ProgressBarStyle

ProgressBarIndicatorStyle

ButtonStyle

CancelButton

ASPxUploadControl Class

ASPxUploadControl Members

DevExpress.Web Namespace