Click here to Skip to main content
13,293,474 members (55,548 online)
Rate this:
Please Sign up or sign in to vote.
I have been at this for 3 days now.
I have had success using this example:[^]

What I'm trying to do is take a 1px wide image and grow it to indicate the progress.
I also have a label that I want to update that shows the % of progress, and another label that receives a status message of the last step completed.

In the example above, I was able to accomplish those 3 steps with the timers trigger. By copying the subs code and pasting it inside the timer tick event.

Protected Sub progressbarmove(percentage As Double, Optional status As String = "")
Dim increment = img_pb_prgrs.Width.Value
increment += (200 * percentage)
If increment (greater than symbol)  200 Then increment = 200
img_pb_prgrs.Width = increment
lbl_prgrs.Text = ((increment / 200) * 100) & "%"
lbl_publish_status.Text = status

But when I take it out of the timer, and implement the action via a button click. No updates happen, it goes from 0 to 100% with no in between updates. So I know the action code is working so I think my problem is in properly implementing the update panel/triggers/contenttemplates to process?

I have an asp:updatepanel set to conditional
I have an asp:image id: img_pb_prgrs that is set to 0px wide on page load.
I have an asp:button id: btn_publish that has this code behind:
Protected Sub ib_pub_convergent_Click(normal auto gen code)
Checks network resource A is online
Calls progressbarmove_convergent(0.1) ' 0.1 for 10%
Checks network resource B is online
Calls progressbarmove_convergent(0.1)
Logs into the resources via impersonation
Calls progressbarmove_convergent(0.1)
Checks can now access a file on the  resource A 
Calls progressbarmove_convergent(0.1)
Checks can now access a file on the  resource B
Calls progressbarmove_convergent(0.1)
Does a FileSystem.CopyDirectory
Calls progressbarmove_convergent(0.1)
Releases impersonation
Calls progressbarmove_convergent(0.1)
Command Complete
Calls progressbarmove_convergent(1)

I have tried 3 core approaches:
1. Trying to get the update panel to work with the button click event.
2. Implementing the timer, turning it off by default. setting my action code within the timer tick event, button click enables the timer, at the end of the action code, disabled the timer.
3. In testing as noted above, set a high interval, and put the action code right in the tick event.

All 3 have called and executed the action code, just the update events never update the webpage. I am testing latest FF and IE8, with IE8 being the target platform. Since it behaves the same in each, I do not believe it to be a browser issue.

So if anyone can help me with a reference example etc. I'd greatly appreciate it.
I use VB almost exclusively, and have little exposure to java or the c's etc so I have been trying to create my solution with the provided tools in vs2010 and avoiding java etc. Sorry for lack of full code, I junked it all in an attempt to start fresh.
Posted 15-Jun-12 10:31am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171207.1 | Last Updated 4 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100