Welcome Guest Search | Active Topics | Sign In | Register

How to call ProgressBar UpdateProgress() from Server operations Options
JRB
Posted: Wednesday, January 7, 2015 3:41:43 PM
Rank: Newbie
Groups: Member

Joined: 1/7/2015
Posts: 6
Being a 'Newbie" I have a lot of dumb questions - the answer for which might be evident to the more experienced user, but please be patient with me....

Anyway - I now have the EO ProgressBar resident in my VS2008 Toolbox.
And I have placed the object (ProgressBar1) onto my web form
I need to 'drive' the update of the ProgressBar from operations occurring on my Server

In the demo code that you provide, you show the progress bar being automatically updated from 0-99.
That is good, but I need to know how to make my own VB.net code to do the as-needed ProgressBar update.

I made my own subroutine to handle the update - guessing what might be needed based on the Demo code

Code:

   Protected Sub ProgressBar1_Update(ByVal sender As Object, ByVal e As EO.Web.ProgressTaskEventArgs)
     Dim i As Int16 = Session("ProgressPcnt")   ' -- Session("ProgressPcnt") contains the current progress percentage.
     e.UpdateProgress(i)
   End Sub


First - is that code a correct usage of your methods?
Secondly - I am not sure what parameters need to be used to make the call to that routine.
** What should be my 'sender'?
** What should be my 'e'?

Thanks,
JRB
JRB
Posted: Wednesday, January 7, 2015 5:14:16 PM
Rank: Newbie
Groups: Member

Joined: 1/7/2015
Posts: 6
I see your 'starter' code in the posting: http://www.essentialobjects.com/forum/postst578_Progress-Bar--Stop-the-task-from-code-behind.aspx
That is a very good starting point.

However, rather than doing my "perform other tasks..." within the ProgressBar1_RunTask, I need to preform it elsewhere and then call the routine to merely Update the ProgressBar1.

And, even if I were to run my 'other tasks..." code in that routine I need to better understand how to 'trigger' the ProgressBar1.RunTask routine

Thanks,
JRB

eo_support
Posted: Wednesday, January 7, 2015 8:25:11 PM
Rank: Administration
Groups: Administration

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

Please let us know if you already have a license for any of our product. Because ProgressBar is a free control, we only provide free tech support to paid users. So if you already have a license for any of our product, you can PM us with your order number and we will be able to answer your questions.

Thanks!
JRB
Posted: Thursday, January 8, 2015 9:54:40 AM
Rank: Newbie
Groups: Member

Joined: 1/7/2015
Posts: 6
Hello,

I understand. However there should be a reasonably priced support option for those of us who are new to ASP.Net

In one of your previous posts I see where you indicate:
Quote:
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.


Is that option still available to us?

Thanks

eo_support
Posted: Thursday, January 8, 2015 11:10:47 AM
Rank: Administration
Groups: Administration

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

We could still do that but it won't help you to resolve this issue and you would be paying for nothing (the price has increased as well). The reason is there is no way the ProgressBar control can figure out the progress of your own task. It has no knowledge of what task you are doing and how much your task has completed at what speed. You will have to provide that information to the ProgressBar control. So this basically is a generic programming question: how to report progress information for your own specific long running task. Depending on your specific task, this can be very easy or very difficult or even impossible. For example, if your task is to process 100 records in a loop then obviously you can just call UpdateProgress in your loop. But if your task is to run a stored procedure on the database that does a long batch processing then it might be impossible for you to get progress information at all. The ProgressBar is a UI control, it has no magic to figure your business logic out. So it's all on your end and has nothing to do with the ProgressBar control. From the ProgressBar point of view, you need to call UpdateProgress to report progress to it. How to do that is completely up to you.

Thanks!
JRB
Posted: Thursday, January 8, 2015 11:35:38 AM
Rank: Newbie
Groups: Member

Joined: 1/7/2015
Posts: 6
Again, on a previous posting ( http://www.essentialobjects.com/forum/postst6152_How-to-raise-ProgressBar-RunTask-event-from-serverside-c.aspx ) you say:
Quote:
//The following code renders a piece of JavaScript code to the the client that calls the ProgressBar's client side JavaScript interface to start the ProgressBar


So with that in mind, would the general approach be to:
1-A. Have a 'standard' event (such as a Button_Click, etc.) fire off the javascript code to start the ProgressBar_RunTask method
1-B. Within the ProgressBar object set the StartTaskButton property to the intended Form object (Button, etc.) and use it to start the ProgressBar_RunTask method
2. Have the ProgressBar_RunTask method run the desired back-end processing while Updating the ProgressBar

One thing to note is that if the ProgressBar is initially set to Visible = False, then the StartTaskButton will not 'Fire'.
Instead the intended button will 'Fire' its own Click method.

So I had to set it Visible=True and then use StartUp javascript code to change its document.getElementByID("ProgressBar1").style.display="none" to make it invisible
That allowed the StartTaskButton to 'Fire'

But when I put my intended code into the ProgressBar1_RunTask subroutine, I encountered problems executing simple code.
When I tried to execute a simple
Code:
If RadioButton2.SelectedValue <> "" then
I got a Server error and I could not get around that.

Thanks
eo_support
Posted: Thursday, January 8, 2015 11:39:20 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Now this will cost you. :) We will PM you with the price and payment details.

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.