mainrotor
asked on
I need help displaying a label on my ASP.Net 3.5 application
Hi Experts,
I have an ASP.Net 3.5 application with VB.Net codebehind. In my application I have a button that initiates some processing, and a label. When the button gets pushed, it calls various functions. I want the text of the label to change at the start of every function (sort of like a process status display). I have written code to do this, but the text of the label only changes after all the processing is complete. What can I do to fix this?
Thank you in advance,
mrotor
I have an ASP.Net 3.5 application with VB.Net codebehind. In my application I have a button that initiates some processing, and a label. When the button gets pushed, it calls various functions. I want the text of the label to change at the start of every function (sort of like a process status display). I have written code to do this, but the text of the label only changes after all the processing is complete. What can I do to fix this?
Thank you in advance,
mrotor
Okay, I can see your code now (I'm on the road, with a very slow connection.)
ASKER
Here is my code so you can just copy and paste it.
Protected Sub cmdFormat_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdFormat.Click
lblError.Text = "Formatting report, please be patient..."
Call ReportFirstSection()
lblError.Text = "First section completed..."
Call ReportSecondSection()
lblError.Text = "Second section completed..."
Call sL2_FormatReport()
lblError.Text = "Excel formatting completed successfully"
End Sub
ASKER
Chaosian,
Yes, the text should display the following after the processing is complete:
lblError.Text = "Excel formatting completed successfully"
Yes, the text should display the following after the processing is complete:
lblError.Text = "Excel formatting completed successfully"
The basic solution is going to involve some form of AJAX. (AJAX is a technology that allows you to retrieve data from the server, and update part of a page rather than having to refresh the whole thing. It's the fundamental technology that allows websites to act like desktop apps from a user experience perspective.)
Here's a couple options that might help:
http://www.redips.net/javascript/ajax-progress-bar/
http://www.aspnettutorials.com/tutorials/themes/progress-bar-csharp.aspx
(The second one of these is loaded with advertising, but has the benefit of providing a link to a VB version at the bottom of the page.)
Here's a couple options that might help:
http://www.redips.net/javascript/ajax-progress-bar/
http://www.aspnettutorials.com/tutorials/themes/progress-bar-csharp.aspx
(The second one of these is loaded with advertising, but has the benefit of providing a link to a VB version at the bottom of the page.)
You could try changing the text with javascript after you call each function.
The problem I feel with Progress Bar in this situation is, he won't be able to display different messages for each funcs
ASKER
rick_gwu,
How can I change the text with JavaScript, can you provide a sample?
mrotor
How can I change the text with JavaScript, can you provide a sample?
mrotor
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There you go. Thanks CodeCruiser for providing the examples.
If you cut and paste the code, I can help you with this.
Are there any other requirements, such as changing the text back after the processing is complete?