ASPxUploadControl.ShowUploadButton Property
Namespace: DevExpress.Web
Assembly:
DevExpress.Web.v24.2.dll
Declaration
[DefaultValue(false)]
public bool ShowUploadButton { get; set; }
<DefaultValue(False)>
Public Property ShowUploadButton As Boolean
Property Value
Type |
Default |
Description |
Boolean |
false |
true , if the button is visible, otherwise, false .
|
Use the ShowUploadButton property to specify whether the Upload button is visible within the ASPxUploadControl.
The appearance of this button can be customized by using the ASPxUploadControl.ButtonStyle property. The upload button‘s image and text are defined via the ASPxUploadControl.UploadButton property.
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.
function OnUploadStart() {
btnUpload.SetText("Uploading...");
btnUpload.SetEnabled(false);
}
function OnUploadComplete(args) {
btnUpload.SetText("Upload");
btnUpload.SetEnabled(true);
lblFileName.SetText(args.callbackData);
}
<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>
<br/>
<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