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

ProgressArea will not display after two times

5 Answers 143 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Jelle
Top achievements
Rank 1
Jelle asked on 24 Aug 2011, 02:38 PM
Hi,

I hope i'm in correct subforum, i can't find one for progressarea and manager.

I've an issue with the ProgressArea control, as first i will describe the scenario:
At page default.aspx we have toolbar and grid. The grid displays list with all XML files available from a folder. After choosing a XML file, RadWindow will be displayed. In this window we will read the XML and process all contents into database. This take some time to complete, so we will display progressarea control to show the status to user. This works very well at first time but after second or third or fourth time the progressarea will not shown.

The progressarea showns with postback only, so we're forcing a postback when the window loads first time.
The code below is a stripped version. The progress will take more than 1 minute. The progress will reach 100 percent.

RadWindow:
<head runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
        function StartSync(sender, args) {
            sender.click();
        }
   </script>
</head>
<body>
    <form id="frm" runat="server">
 
        <div style="display: none">
            <telerik:RadButton ID="cmdSync" runat="server" OnClientLoad="StartSync" />
        </div>
 
        <div style="padding-top: 10px;">
        <telerik:RadScriptManager id="ScriptManager1" runat="server" />
        <telerik:RadProgressManager id="radProcessMan" runat="server" />       
        <telerik:RadProgressArea id="radProcessArea" runat="server" Width="375px" SkinID="radProcArea">
        <Localization CurrentFileName="Koppelen:" UploadedFiles="Status:" />
        <ProgressTemplate>
            <ul class="ruProgress" style="background-image: none; padding-top: 10px;">
                <li class="ruFileCount">
                    <div id="SecondaryProgressBarOuterDiv" class="ruBar" runat="server">
                        <div id="SecondaryProgressBarInnerDiv" runat="server">
                            <!-- -->
                        </div>
                    </div>
                    Status: <span id="SecondaryPercent" runat="server"></span>% (<span id="SecondaryValue" runat="server"></span>)
                </li>
                <li class="ruCurrentFile" style="font-size: 12px;">
                    Bestand: <br />
                    <div style="height: 30px; overflow: hidden;">
                        <b><span id="CurrentOperation" runat="server" style="font-size: 12px"></span></b>
                    </div>
                </li>
            </ul>
        </ProgressTemplate>
    </telerik:RadProgressArea>
        </div>
    </form>
</body>
</html>

Codebehing RadWindow:
Imports Telerik.Web.UI
 
Partial Class frmSync
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            radProcessArea.ProgressIndicators = Upload.ProgressIndicators.CurrentFileName Or _
                    Upload.ProgressIndicators.FilesCount Or _
                    Upload.ProgressIndicators.FilesCountBar Or _
                    Upload.ProgressIndicators.FilesCountPercent
        End If
    End Sub
 
    Protected Sub cmdSync_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdSync.Click
        doSync()
 
        ClientScript.RegisterClientScriptBlock(GetType(Page), "CloseWindow", "GetRadWindow().close()", True)
    End Sub
 
    Private Sub doSync()
        Dim counter As Integer
 
        Dim i As Integer
        Dim strFileName As String    
 
        'set progress to zero
        UpdateProgress(0, "adressen verwerken...", 0, 0)
 
        Try
            strFileName = "c:\temp\xmlfile.xml"
 
            If File.Exists(strFileName) Then
                xmldoc = New XmlDocument
                xmldoc.Load(strFileName)
 
                counter = xmldoc.SelectNodes("/nodes").Count
 
                i = 0
                Dim xmlNode As XmlNode
                For Each xmlNode In xmldoc.SelectNodes("/nodes")
 
                    'Process each node
 
                    'update progressbar
                    UpdateProgress(CInt(i / (counter / 100)), "", counter, i)
                    i += 1
 
                Next
 
            End If
 
          Catch ex As Exception
            exceptions.log.Publish(ex)
        Finally
            xmldoc = Nothing
        End Try
 
    End Sub
     
    Private Sub UpdateProgress(ByVal intPercent As Integer, ByVal strMessage As String, ByVal intCount As Integer, ByVal intCurrent As Integer)
        Dim radProgress As RadProgressContext
        Try
                radProgress = RadProgressContext.Current
                radProgress.SecondaryPercent = intPercent
                radProgress.SecondaryTotal = 100
                radProgress.SecondaryValue = String.Format("adres {0} van {1} adressen", intCurrent, intCount)
                radProgress.CurrentOperationText = strMessage
           
        Catch ex As Exception
            exceptions.log.Publish(ex)
        End Try
    End Sub
 
 
End Class

5 Answers, 1 is accepted

Sort by
0
Jelle
Top achievements
Rank 1
answered on 24 Aug 2011, 02:45 PM
Extra information:
It doesn't matter if i reloads the default.aspx page (grid), it stay hidden after first or second succesfully progressing. But when i stop debugging and close the Development Server en restart debugging it will display again. It seems it will not be completed or closed after first or second time.
0
Peter Filipov
Telerik team
answered on 29 Aug 2011, 09:50 AM
Hello Jelle,

From the provided sample code I wasn't able to reproduce your issue. Could you please send me a working sample project to investigate it locally?

Greetings,
Peter Filipov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Erick
Top achievements
Rank 2
answered on 30 Aug 2011, 02:17 PM
Hi,

You can download a test project from: http://www.em-cultuur.nl/test.zip.
This project is a stripped version with sleeps instead of real processing code.

Please select a XML file from the grid and press Sync button.
I will receive Ajax Callback error while opening RadWindow.
After some times the progressbar will not display.

Is there a solution for ProgressBar with multithreading?
We need to run sync outside the current thread so the users can continue with their work while synchronizing.

Very much thanks!
0
Peter Filipov
Telerik team
answered on 02 Sep 2011, 09:16 AM
Hi Erick,

Unfortunately the provided link is not working. If you find some difficulties to attach it live, please open a support ticket and attach the sample project.

Regards,
Peter Filipov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Erick
Top achievements
Rank 2
answered on 12 Sep 2011, 12:53 PM
Hi,

Because this issue have cost us a lot of time, we've stop searching for a solution.
And replaced the RadProgressArea with own custom ajaxfied progressbar.

I'm not saying that your ProgressArea control is bad but it has an annoying problem.

But very much thanks for your help so far.

Kind regards,

Jelle
Tags
AsyncUpload
Asked by
Jelle
Top achievements
Rank 1
Answers by
Jelle
Top achievements
Rank 1
Peter Filipov
Telerik team
Erick
Top achievements
Rank 2
Share this question
or