I'm using Rad upload control with rad progressarea and rad progress manager in a user control.
<%
@ Control Language="C#" AutoEventWireup="true" Inherits="wucPreliminaryPlans" CodeBehind="wucPreliminaryPlans.ascx.cs" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
table>
<tr>
<td>
<telerik:RadUpload ID="rdupload" runat="server" ControlObjectsVisibility="None"
MaxFileInputsCount="1"
OverwriteExistingFiles="false" TargetFolder="~/Uploads/MyFiles"
OnFileExists="rdupload_FileExists">
</telerik:RadUpload>
</td>
</tr>
<tr>
<td>
<asp:Button id="buttonSubmit" runat="server" OnClick="buttonSubmit_Click" text="Submit" />
<asp:Label ID="labelNoResults" runat="server" Visible="True">No uploaded files yet</asp:Label>
</td>
</tr>
<tr><td>
<telerik:RadProgressManager ID="rdUploadProgressManager" runat="server" />
<telerik:RadProgressArea ID="rdUploadProgress" runat="server" Language=""
ProgressIndicators="TotalProgressBar, TotalProgress, TotalProgressPercent, RequestSize, FilesCountBar, FilesCount, FilesCountPercent, SelectedFilesCount, TimeElapsed, TimeEstimated, TransferSpeed"
Skin="Vista" >
<Localization Uploaded="Uploaded"></Localization>
</telerik:RadProgressArea>
</td>
</tr>
</table>
Code behind.
protected
void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//Do not display SelectedFilesCount progress indicator.
rdUploadProgress.ProgressIndicators &= ~
ProgressIndicators.SelectedFilesCount;
}
}
protected
void buttonSubmit_Click(object sender, System.EventArgs e)
{
if (rdupload.UploadedFiles.Count>0)
{
labelNoResults.Text =
"Thanks for Uploading";
}
else
{
labelNoResults.Text =
"No files to upload";
}
}
it is working fine for even i click the upload btn.
But problem arises whenever my page is postback and if i have a value in the rad upload ,
it is uploading automatically.
Is there anyway to stop this.
Thanks,
Hari.