This is a migrated thread and some comments may be shown as answers.

Custom Progress Area inside RadAjaxPanel

1 Answer 136 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Jill Allison
Top achievements
Rank 1
Jill Allison asked on 02 Mar 2010, 04:44 PM
Hello,

I am having very strange behavior with the ProgressArea embedded inside a RadAjaxPanel.  I have created a prototype of this problem using code from your RadControlsExample solution (version Q1 2009).

I have one RadAjaxPanel that includes the following:
  1. A button that causes a callback
  2. A button that is tied to the RadProgress
  3. The RadProgressManager and RadProgressArea

When I load the page for the first time and click the "Show Progress Area" button, the resulting behavior is what I want. 

If, however, I click the "Cause Postback" button first after loading the page, THEN click the "Show Progress Area" button, the progress area does not display at all. 

Is this a bug with Telerik, or is there something I'm doing wrong or something I can do extra to fix?

Thanks,
Jill

Markup:
<%@ Page language="c#" CodeFile="Testing.aspx.cs" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Upload.CustomProgress.Testing" %> 
<%@ register tagprefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %> 
<%@ register tagprefix="qsf" namespace="Telerik.QuickStart"  %> 
<%@ register tagprefix="qsf" tagname="Header" src="~/Common/Header.ascx" %> 
<%@ register tagprefix="qsf" tagname="HeadTag" src="~/Common/HeadTag.ascx" %> 
<%@ register tagprefix="qsf" tagname="Footer" src="~/Common/Footer.ascx" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
        <qsf:headtag runat="server" /> 
          
        <telerik:RadScriptBlock ID="rcbExport" runat="server">  
        <script language="javascript" type="text/javascript">  
            function showProgressArea() {  
                getRadProgressManager().startProgressPolling();  
            }              
        </script>     
        </telerik:RadScriptBlock>                 
    </head> 
    <body class="BODY">  
        <form runat="server" id="mainForm" method="post">  
          
            <telerik:RadScriptManager id="ScriptManager1" runat="server" /> 
              
            <qsf:Header runat="server" NavigationLanguage="C#" />     
              
            <!-- Start UpdatePanel 1 --> 
            <telerik:RadAjaxPanel runat="server" ID="UpdatePanel1" LoadingPanelID="RadAjaxLoadingPanel1">  
                Click this button first:    
                <asp:Button ID="btnPostBack" runat="server" Text="Cause Postback" /><br /> 
 
                Click this button to show Progress Area:  
                <asp:button ID="buttonSubmit" runat="server" Text="Show Progress Area" OnClientClick="showProgressArea();" OnClick="buttonSubmit_Click" CssClass="RadUploadButton" /> 
                  
                <telerik:RadProgressManager id="Radprogressmanager1" runat="server" RegisterForSubmit="false" /> 
                  
                <telerik:RadProgressArea id="RadProgressArea1" runat="server" /> 
                  
                  
                  
                <br /><br /><br /><br /><br /><br /> 
                  
                <div class="bigModule">  
                    <div class="bigModuleBottom">  
                        <b>Note:</b> The largest allowed combined file size for upload in this example is 100MB. This is specified by the  
                        maxRequestLength="102400" set in Web.config file. If you attempt to upload files with total size greater that 100MB   
                        you will get "Page Not Found" error. For more information about uploading large files visit the help article  
                        <href="http://www.telerik.com/help/aspnet-ajax/upload_uploadinglargefiles.html" >Uploading Large Files</a>   
                    </div> 
                </div> 
            </telerik:RadAjaxPanel> 
            <!-- End Update Panel 2--> 
              
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">  
            </telerik:RadAjaxLoadingPanel>            
            <qsf:Footer runat="server" /> 
        </form> 
    </body> 
</html> 
 

Code-behind:
using System;  
using System.Collections;  
using System.ComponentModel;  
using System.Data;  
using System.Drawing;  
using System.Web;  
using System.Web.SessionState;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.HtmlControls;  
using Telerik.Web.UI;  
using Telerik.Web.UI.Upload;  
 
namespace Telerik.Web.Examples.Upload.CustomProgress  
{  
    public partial class Testing : System.Web.UI.Page  
    {     
        protected void Page_Load(object sender, System.EventArgs e)  
        {  
            if (!IsPostBack)  
            {  
                //Do not display SelectedFilesCount progress indicator.  
                //RadProgressArea1.ProgressIndicators &= ~ProgressIndicators.SelectedFilesCount;  
            }  
 
        }  
 
        protected void buttonSubmit_Click(object sender, System.EventArgs e)  
        {  
            LooongMethodWhichUpdatesTheProgressContext();  
        }  
 
        private void LooongMethodWhichUpdatesTheProgressContext()  
        {  
            const int total = 100;  
              
            RadProgressContext progress = RadProgressContext.Current;  
 
            for (int i = 0; i < total; i++)  
            {  
                progress.PrimaryTotal = 1;  
                progress.PrimaryValue = 1;  
                progress.PrimaryPercent = 100;  
 
                progress.SecondaryTotal = total;  
                progress.SecondaryValue = i;  
                progress.SecondaryPercent = i;  
 
                progress.CurrentOperationText = "Processing...";  
 
                if (!Response.IsClientConnected)  
                {  
                    //Cancel button was clicked or the browser was closed, so stop processing  
                    break;  
                }  
 
                //Stall the current thread for 0.1 seconds  
                System.Threading.Thread.Sleep(100);  
            }  
 
            progress.OperationComplete = true;  
        }     
    }  
}  
 

1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 08 Mar 2010, 03:18 PM
Hello Jill Allison,

In order to have the area working, please move it outside of the RadAjaxPanel. I have tested that on the code that you have provided and it seems to work without a problem.

RadProgressArea does not need to be in AJAX panel. It has its own AJAX mechanism. Leave the submit buttons only in the RadAjaxPanel

Regards,
Genady Sergeev
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
Upload (Obsolete)
Asked by
Jill Allison
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or