I have an async upload control in my page along with a grid view wherein all the uploads are displayed. When I click on a line item in a grid I have a download file functionality. But, whenever I click on the download file link, the progress area appears which is not expected. the progress area is only meant for the upload control but not for the download. How do I sort this issue out?
9 Answers, 1 is accepted
The ProgressArea shouldn't appears if you don't update the RadProgressContext on the server:
RadProgressContext context = RadProgressContext.Current;
Regards,
Hristo Valyavicharski
Telerik
Hi Hristo
I tried using the above piece of code, but still the Progress Area shows on click of download link.
Any other alternative would really help.
Thanks
Phanish
Thanks.
Regards,
Hristo Valyavicharski
Telerik
This is the RadGrid method where the download occurs:
protected void grdTaskUploadDocument_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == "Download")
{
int TaskDocId = 0;
string filename = e.CommandArgument.ToString();
if (checkIfDirectoryExists("TaskDocFileUpload"))
{
FileInfo file = new FileInfo(Server.MapPath(string.Format(@"~/Files/{0}/TaskDocFileUpload/", Session["ClientName"].ToString()) + filename));
if (file.Exists)
{
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=" + filename);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.WriteFile(file.FullName);
Response.Flush();
Response.End();
RadProgressContext context = RadProgressContext.Current;
}
}
}
else{.........}
}
This is the Progress Area code in the aspx page :
<telerik:RadAsyncUpload ID="taskDocFileUpload" runat="server" Localization-Select="Browse" Width="227px" MaxFileInputsCount="1" EnableInlineProgress="false" AllowedFileExtensions=".xls,.xlsx,.doc,.docx,.pdf,.txt,.ppt,.pptx,.csv" OnClientValidationFailed="OnClientValidationFailed">
</telerik:RadAsyncUpload>
<telerik:RadProgressManager runat="server" ID="RadProgressManager1" />
<telerik:RadProgressArea runat="server" ID="RadProgressArea1" />
Could you try to remove the following line:
protected void grdTaskUploadDocument_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
if (e.CommandName == "Download")
{
int TaskDocId = 0;
string filename = e.CommandArgument.ToString();
if (checkIfDirectoryExists("TaskDocFileUpload"))
{
FileInfo file = new FileInfo(Server.MapPath(string.Format(@"~/Files/{0}/TaskDocFileUpload/", Session["ClientName"].ToString()) + filename));
if (file.Exists)
{
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=" + filename);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.WriteFile(file.FullName);
Response.Flush();
Response.End();
RadProgressContext context = RadProgressContext.Current;
}
}
}
else{.........}
}
Does it help?
Regards,
Hristo Valyavicharski
Telerik
Hi,
I am trying to do the opposite here but can't get it to work.
A RadGrid with Download buttons, downloads from FTP location.
I placed RadProgressBar and RadProgressManager on the page.
Is it necessary to place a upload object on the page for the Progress to show?
I did that but still no Progress rendered...
Marc
As far as I can understand, you want to track the download process and report it to the user, using RadProgressBar or RadProgressArea. If this is your case, I am afraid that none of the Telerik controls will allow you to to do that out-of-the-box. Nevertheless, if you decide to proceed with a custom implementation of the above, you could consult the resources, suggested in the following forum post.
Regards,
Veselin Tsvetanov
Telerik by Progress