Welcome Guest Search | Active Topics | Sign In | Register

How does one call the ProgressBar1_RunTask event? Options
Brian
Posted: Thursday, November 18, 2010 12:53:20 PM
Rank: Newbie
Groups: Member

Joined: 11/18/2010
Posts: 7
I have a button on my web page. When that button is clicked, I want for the ProgressBar1_RunTask event to get called.


Code: Visual Basic.NET
Protected Sub btnGo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnScan.Click

        'Start progress bar ProgressBar1_RunTask

End Sub
eo_support
Posted: Thursday, November 18, 2010 1:41:08 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You would just set the ProgressBar's StartButton to that button and the ProgressBar will trigger ProgressBar1_RunTask event for you.

If you still have any questions about the ProgressBar, you can take a look of the source code of our samples to see how it works or consider purchashing a license for any of our product because officially we do not provide free technical support for our free controls.

Thanks!
Brian
Posted: Thursday, November 18, 2010 2:03:00 PM
Rank: Newbie
Groups: Member

Joined: 11/18/2010
Posts: 7
Thank you very much for the reply. I did what you suggested in the properties window within Visual Studio. Then I clicked the button on the web page in runtime, but the following gets displayed:

"There is no handler for the ProgressBar's RunTask event. (set ClientSideOnError to handle this error). You can turn off this message by setting EO.Web.Runtime.DebugLevel to 0 (Not recommended for debug build)."

My RusTask event is below.

Code: Visual Basic.NET
Protected Sub ProgressBar1_RunTask(ByVal sender As Object, ByVal e As EO.Web.ProgressTaskEventArgs)

        'Prepare progress bar to start.
        e.UpdateProgress(0, "Running...")

        'Loop through files.
        For i As Integer = 0 To 99

            'Stop the task as soon as we can if the user has stopped it from the client side.
            If (e.IsStopped = True) Then
                Exit For
            End If

            'Here we call Thread.Sleep just for demonstration
            'purpose. You should replace this with code that
            'performs "one step" of your long running task.
            System.Threading.Thread.Sleep(500)

            'You should frequently call UpdateProgress in order
            'to notify the client about the current progress
            e.UpdateProgress(i)

        Next i

        'All done.
        e.UpdateProgress(100, "All done!")

    End Sub


If I can get this sample working, I would certainly consider purchasing the controls.
eo_support
Posted: Thursday, November 18, 2010 2:16:12 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You just have to attach the handler to the control. The easiest way is to select the control, then go to the event tab and double click RunTask event and Visual Studio should be able to generate an empty handler for you. You can then copy whatever code you had into that handler. You can also manually add "Handles ProgressBar1.RunTask" at the end of the event handler so it looks like this:

Code: Visual Basic.NET
Protected Sub ProgressBar1_RunTask( _
    ByVal sender As Object, ByVal e As EO.Web.ProgressTaskEventArgs) _
    Handles ProgressBar1.RunTask
.....

End Sub


Hope this helps.

Thanks
Brian
Posted: Thursday, November 18, 2010 2:49:30 PM
Rank: Newbie
Groups: Member

Joined: 11/18/2010
Posts: 7
That worked! Thanks! Nice support!
Brian
Posted: Tuesday, November 30, 2010 6:29:40 PM
Rank: Newbie
Groups: Member

Joined: 11/18/2010
Posts: 7
I was able to get the RunTask event working. Is there an example (code behind and UI page) of how to use the advanced progress bar feature where a callback event can be invoked after the progress bar value has completed?
eo_support
Posted: Tuesday, November 30, 2010 8:25:42 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
No. That is not possible. You can not have another server call while one is running. ASP.NET does not allow multiple calls from the same session at the same time --- that is why you never have to worry about synchronizing when accessing session variables.

Thanks!
Brian
Posted: Wednesday, December 1, 2010 10:06:05 AM
Rank: Newbie
Groups: Member

Joined: 11/18/2010
Posts: 7
In the example (http://demo.essentialobjects.com/Demos/Progress%20Bar/Server%20Side%20Task%20-%20Advanced%202/Demo.aspx), notice how extra words were displayed automatically after the scan is finished? That's what I am referencing.
eo_support
Posted: Wednesday, December 1, 2010 10:12:58 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
I see. The remark section for that sample explains how it is implemented in great detail. So if you still have any question, you may want to take a look of that first. The complete source code for the sample is also available in the samples directory.

Thanks
Brian
Posted: Wednesday, December 1, 2010 10:22:13 AM
Rank: Newbie
Groups: Member

Joined: 11/18/2010
Posts: 7
Instead of displaying text in a label after the progress bar completes, is there a way to display data inside of a datagrid (by calling a method that has the data ready to be bound to the datagrid)?
eo_support
Posted: Wednesday, December 1, 2010 10:30:03 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You can display anything you would like. The key is your code is called when the ProgressBar is done. Once the control is handled over to you, you can do anything possible with your code and it no longer has anything to do with the ProgressBar.

We have already gone to great length to help you get started with the ProgressBar control even though officially we do not offer free tech support for our free controls. If you still have any questions about the progress bar controls, we will need you to either purchase a license or pay a one time support fee of $30/ticket.

Thanks!
Brian
Posted: Wednesday, December 1, 2010 10:39:11 AM
Rank: Newbie
Groups: Member

Joined: 11/18/2010
Posts: 7
eo_support
Posted: Wednesday, December 1, 2010 10:55:43 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Oh. You don't pay for the ProgressBar. : ) We offer the ProgressBar as a free control so you can use it without a license. However our ProgressBar is quite popular and providing technical support for a free product can cost us significant resource. Thus our official policy is we do not provide free tech support on our free controls. In order to receive support on our free controls, you must be a paid customer within an active support period. A license for any of our product would qualify you for one year of free tech support on any of our product. A one time support ticket would also do but it only covers a single issue.

The lowest price for any of our control is $99, so if you are also interested in any other controls, you can purchase a standard license for that control and it should give you one year of free tech support. Otherwise a one time support ticket might be a better way to go. In any case if you decided to purchase a license after you have already paid the support ticket, you can apply what you have already paid as a credit so you do not pay for support twice.

Please also keep in mind that we do not support issues beyond our product regardless you are a paid customer or not. An obvious example for this is we will not answer questions about how to handle an ASP.NET button’s click event because it is totally unrelated to our product. A more subtle example, take the progress bar as an example, we can tell you how to update the progress bar’s progress, but we will not be able to answer questions such as “how to write code to update 1000 database records and get progress information while updating the records?”. How to update your database records is totally unrelated to our product in this case.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.