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:
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:
Code-behind:
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:
- A button that causes a callback
- A button that is tied to the RadProgress
- 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 |
| <a 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; |
| } |
| } |
| } |