RadUpload Progress Bar not updating

Thread is closed for posting
2 posts, 0 answers
  1. Paul
    Paul avatar
    1 posts
    Member since:
    Jan 2013

    Posted 30 Oct 2013 Link to this post

    I have an ASP.NET user control "Upload.ascx" that contains a RadUpload control that I am using on a page in Sitefinity. Whenever I select a file to upload and submit the form, the ProgressArea appears, but the progress bar does not update, and the remaining time is a really huge number. Then the page posts back, resulting the the progress of the upload never being shown (it stays at 0%, even for large files). I searched around and found some similar issues online, but none of the solutions fixed my problem. I tried switching to a RadAsyncUpload control and changing my web.config runAllManagedModulesForAllRequests value to "true", but neither worked. I also tried a Telerik sample project with a RadUpload control that I found in another support thread, but that also displayed the same issue (but it works on the example page in the Telerik documentation). Might this be an issue with my DLL? I am using Telerik.Web.UI v2012.1.215.40 (Runtime v4.0.30319).

    Thanks in advance for any assistance you can offer!

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Upload.ascx.cs" Inherits="WebComponents.UserControls.CommonControls.Upload.Upload.Upload" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <script type="text/javascript">
        function ValidatePhoneNumber(sender, args) {
            if (document.getElementById('<%= txtPhonePartOne.ClientID %>').value.length < 1 || document.getElementById('<%= txtPhonePartTwo.ClientID %>').value.length < 1 || document.getElementById('<%= txtPhonePartThree.ClientID %>').value.length < 1) {
                args.IsValid = false;
        //auto move cursor through phone fields
        function checkLen(fieldToMeasure, fieldToJump) {
            var currentLength = document.getElementById(fieldToMeasure).value.length;
            if (currentLength == 3) { document.getElementById(fieldToJump).focus() }
        //client side validation for phone number
        function checkPhone(sender, args) {
            if (document.getElementById('<%= txtPhonePartOne.ClientID %>').value.length < 1 || document.getElementById('<%= txtPhonePartTwo.ClientID %>').value.length < 1 || document.getElementById('<%= txtPhonePartThree.ClientID %>').value.length < 1) {
                args.IsValid = false;
        //validate valid file type
        function ValidateRadUpload1(source, arguments) {
            arguments.IsValid = getRadUpload('<%= radUpload.ClientID %>').validateExtensions();
        //update label for upload
        function updateUploadLabel(fieldToUpdate, textToDisplay) {
            var pageIsValid = Page_ClientValidate();
            if (pageIsValid) {
                document.getElementById(fieldToUpdate).innerHTML = textToDisplay;
    <asp:Label ID="lblErrorMessage" runat="server"></asp:Label>
    <asp:ValidationSummary ID="vsForm" runat="server" CssClass="errorsummary" />
    <fieldset class="radContainer">
            <asp:Literal ID="litDocumentUploadHeader" runat="server" Text="<%$ Resources:litDocumentHeader %>"></asp:Literal></legend>
            <asp:Literal ID="litAllowedFileTypes" runat="server" Text="" /></p>
        <div class="input">
            <label for="ddlInquiryType">
                <asp:Literal ID="litDocumentType" runat="server" Text="<%$ Resources:litDocumentType %>"></asp:Literal>
            <asp:DropDownList ID="ddlDocumentType" CssClass="first" runat="server" AppendDataBoundItems="true">
            <asp:RequiredFieldValidator ID="reqDocumentType" ErrorMessage="<%$ Resources:reqDocumentType %>"
                ControlToValidate="ddlDocumentType" Display="Dynamic" runat="server" Text="*"
        <br class="end" />
        <div class="file">
            <asp:Literal ID="litUpload" runat="server" Text="<%$ Resources:litUpload %>" /><br />
            <telerik:RadUpload ID="radUpload" runat="server" InputSize="45" Width="500px" Skin="Test"
                EnableEmbeddedSkins="false" />
            <asp:CustomValidator runat="server" Display="none" CssClass="errorindicator" ID="cusFileType"
                ClientValidationFunction="ValidateRadUpload" OnServerValidate="radUploadCustomValidator_ServerValidate"
                ErrorMessage="<%$ Resources:cusFileType %>" />
            <asp:Label ID="lblNoResults" runat="server" Visible="True" CssClass="transferMessage" />
            <telerik:RadProgressManager ID="radProgressManager" runat="server" />
            <telerik:RadProgressArea runat="server" ID="ProgressArea1" DisplayCancelButton="True"
                ProgressIndicators="TotalProgressBar, TotalProgress, RequestSize, FilesCountBar, FilesCount, SelectedFilesCount, CurrentFileName, TimeElapsed, TimeEstimated, TransferSpeed"
                Skin="Default" EnableEmbeddedSkins="true">
                <Localization Uploaded="Uploaded" />
    <div class="input comment">
        <asp:Literal ID="litComments" runat="server" Text="<%$ Resources:litComments %>"></asp:Literal>
        <asp:RegularExpressionValidator ID="regexComments" runat="server" CssClass="errorindicator"
            ControlToValidate="txtComments" Text="*" Display="Dynamic" EnableClientScript="false"
            ErrorMessage="<%$ Resources:regexComments %>" ValidationExpression="^.[\s\S]{1,10000}$"></asp:RegularExpressionValidator>
        <asp:TextBox ID="txtComments" runat="server" TextMode="MultiLine" MaxLength="10000" />
    <div class="end">
    <div id="divSubmit">
        <asp:Button ID="btnSubmit" runat="server" Text="<%$ Resources:btnSubmit %>" OnClick="btnSubmit_Click" />

    using InstalledWebComponents.Library.Email;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Linq;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Telerik.Sitefinity.GenericContent.Model;
    using Telerik.Sitefinity.Lists.Model;
    using Telerik.Sitefinity.Modules.Lists;
    using Telerik.Sitefinity.Workflow;
    using Telerik.Web.UI;
    namespace WebComponents.UserControls.CommonControls.Upload.Upload
        public partial class Upload : System.Web.UI.UserControl
            private const string LIST_NAME = "Upload Document Types";
            Regex regEx = new Regex(@"^([\(]{1}[0-9]{3}[\)]{1}[\.| |\-]{0,1}|^[0-9]{3}[\.|\-| ]?)?[0-9]{3}(\.|\-| )?[0-9]{4}$");
            private string _onCompletionRedirectUrl;
            private string ldc = string.Empty;
            [Personalizable(PersonalizationScope.Shared), WebBrowsable(), WebDisplayName("On completion redirect user to this page"), WebDescription("On completion redirect user to this page")]
            [System.ComponentModel.Description("On completion redirect user to this page.")]
            public string OnCompletionRedirectUrl
                    if (string.IsNullOrEmpty(_onCompletionRedirectUrl))
                        _onCompletionRedirectUrl = "~/thankyou";
                    return _onCompletionRedirectUrl;
                set { _onCompletionRedirectUrl = value; }
            protected void Page_Init(object sender, EventArgs e)
            protected void Page_Load(object sender, EventArgs e)
                txtPhonePartOne.Attributes.Add("onKeyUp", string.Format("checkLen('{0}','{1}')", txtPhonePartOne.ClientID, txtPhonePartTwo.ClientID));
                txtPhonePartTwo.Attributes.Add("onKeyUp", string.Format("checkLen('{0}','{1}')", txtPhonePartTwo.ClientID, txtPhonePartThree.ClientID));
                string domain = Request.Url.Host.ToUpperInvariant();
            protected void validatePhoneNumber_ServerValidate(object source, ServerValidateEventArgs args)
                string phoneNumber = EmailForm.CombinePhoneNumberParts(txtPhonePartOne.Text, txtPhonePartTwo.Text, txtPhonePartThree.Text);
                if (phoneNumber.Length > 0)
                    args.IsValid = regEx.Match(phoneNumber).Success;
            private void BindInquiryTypes()
                List<Telerik.Sitefinity.Lists.Model.ListItem> list = EmailForm.GetList(LIST_NAME).ListItems.ToList();
                List<string> itemList = new List<string>();
                itemList.Add("Select Document Type");
                for (int index = 0; index < list.Count; index++)
                    if (!itemList.Contains(list[index].Title))
                ddlDocumentType.DataSource = itemList;
            private void SetObjectsVisibility()
                string strAllowedFileType = EmailForm.FindListItem(EmailForm.GetList("Upload Document Allowed File Types"), "allowed file types").Content.ToString();
                string[] arrAllowedFileTypes = strAllowedFileType.Split(new char[] { ',' });
                radUpload.ControlObjectsVisibility = ControlObjectsVisibility.None;
                radUpload.ControlObjectsVisibility |= ControlObjectsVisibility.AddButton;
                radUpload.ControlObjectsVisibility |= ControlObjectsVisibility.RemoveButtons;
                radUpload.MaxFileInputsCount = 5;
                radUpload.MaxFileSize = 524288000; //500MB
                radUpload.AllowedFileExtensions = arrAllowedFileTypes;
                radUpload.Localization.Add = GetLocalResourceObject("RadUploadAddButtonText").ToString();
                litAllowedFileTypes.Text = strAllowedFileType;
            protected void btnSubmit_Click(object sender, EventArgs e)
                if (!Page.IsValid) return;
                if (txtPhonePartOne.Text.Length < 3 || txtPhonePartTwo.Text.Length < 3 || txtPhonePartThree.Text.Length < 4)
                    lblErrorMessage.Text = "Phone Number is not valid";
                if (lblErrorMessage.Text.Length == 0)
            private void ShowResults()
                //load results into session variable
                //todo create session handling class
                ArrayList arlUploadedFiles = new ArrayList();
                ArrayList arlInvalidFiles = new ArrayList();
                if (radUpload.UploadedFiles.Count > 0)
                    foreach (UploadedFile file in radUpload.UploadedFiles)
                    Session["SuccessfullyUploadedFiles"] = arlUploadedFiles;
                if (radUpload.InvalidFiles.Count > 0)
                    foreach (UploadedFile invalidfile in radUpload.InvalidFiles)
                    Session["InvalidFilesRejectedForUpload"] = arlInvalidFiles;
            private bool SendEmail()
                //Sends submitted form data and file(s)
                return true;
            private string BuildEmailBody()
                //Builds email body and returns string
                return "Email body content"
            protected void radUploadCustomValidator_ServerValidate(object source, ServerValidateEventArgs eventArgs)
                eventArgs.IsValid = (radUpload.InvalidFiles.Count == 0);

  2. Peter Filipov
    Peter Filipov avatar
    1028 posts

    Posted 04 Nov 2013 Link to this post

    Hi Paul,

    I have tested the provided code in a sample webforms project and everything is working fine. Could you please clarify that your URL is not structured like in the following help article(limitations number 4). Our recommendation is to us RadAsyncUpload control instead of the RadUpload. It has more features e.g. client side validation and there is no need to make a postback to validate the file. Also the control works out of the box with the RadProgressArea and there is no need for the RadProgressManager.

    Peter Filipov
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top