RadProgressArea appears on click of download

8 posts, 0 answers
  1. Phanish
    Phanish avatar
    8 posts
    Member since:
    Dec 2014

    Posted 04 Jun 2015 Link to this post

    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?

  2. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 09 Jun 2015 Link to this post

    Hi Phanish,

    The ProgressArea shouldn't appears if you don't update the RadProgressContext on the server:

    RadProgressContext context = RadProgressContext.Current;


    Regards,
    Hristo Valyavicharski
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Phanish
    Phanish avatar
    8 posts
    Member since:
    Dec 2014

    Posted 09 Jun 2015 in reply to Hristo Valyavicharski Link to this post

    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

  5. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 09 Jun 2015 Link to this post

    Please paste your code here, so we can review it.

    Thanks.

    Regards,
    Hristo Valyavicharski
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Phanish
    Phanish avatar
    8 posts
    Member since:
    Dec 2014

    Posted 10 Jun 2015 in reply to Hristo Valyavicharski Link to this post

    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" />

  7. Phanish
    Phanish avatar
    8 posts
    Member since:
    Dec 2014

    Posted 10 Jun 2015 in reply to Phanish Link to this post

    PFA the screenshot of the issue I'm facing on clicking th edownload link.
  8. Phanish
    Phanish avatar
    8 posts
    Member since:
    Dec 2014

    Posted 10 Jun 2015 in reply to Phanish Link to this post

    Attachment
  9. Hristo Valyavicharski
    Admin
    Hristo Valyavicharski avatar
    975 posts

    Posted 11 Jun 2015 Link to this post

    Phanish,

    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
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017