Click here to Skip to main content
15,896,359 members

VB VS2010 ASPX: progress bar while doing a 10 step button click

Globeadue asked:

Open original thread
I have been at this for 3 days now.
I have had success using this example: http://ajax.net-tutorials.com/controls/updatepanel-control/[^]

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.

XML
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:
VB
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.
Tags: Visual Basic, .NET, Visual Studio (Visual Studio 2010), UpdatePanel

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900