|
Rank: Newbie Groups: Member
Joined: 7/2/2008 Posts: 7
|
I have server-side code for handeling progress bar. Below is the code
protected void ProgressBar1_RunTask(object sender, EO.Web.ProgressTaskEventArgs e) { Button1.Enabled = false; e.UpdateProgress(25); e.UpdateProgress(50); dotask(); e.UpdateProgress(100); Button1.Enabled = true;
}
private void dotask() { Button1.Text = "process complete"; ListBox1.Items.Add(new ListItem("new item", "1")); }
The RunTask events executes properly but the listbox values are not getting updated, it does not add an item to the listbox and also it does not change the button text. I tried writing these 2 lines in dotask function in the RunTask event iteself but it still does not work. Can you please tell me how to do this?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi,
Please see the progress bar server side event handler sample for more details. The comment in the sample explains this in details.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 7/2/2008 Posts: 7
|
I have tried this already from the sample code available in demos. The below code is same as the sample code but it does not change the control values.
protected void ProgressBar1_RunTask(object sender, EO.Web.ProgressTaskEventArgs e) { e.UpdateProgress(0, "Running...");
for (int i = 0; i < 100; i++) { //Stop the task as soon as we can if the user has //stopped it from the client side if (e.IsStopped) break;
//Here we call Thread.Sleep just for demonstration //purpose. You should replace this with code that //performs your long running task. Button1.Text = "process complete"; ListBox1.Items.Add(new ListItem("new item", "1"));
//You should frequently call UpdateProgress in order //to notify the client about the current progress e.UpdateProgress(i); }
e.UpdateProgress(100, "The task is done!");
}
PLEASE HELP....
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi, Did you see this one? http://www.essentialobjects.com/Demo/Default.aspx?path=ProgressBar\_i2You will want to read the comment. Not the code. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 7/2/2008 Posts: 7
|
Sorry for ignoring the comments. I have got my answer. Thank you very much for your help.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Excellent. Please feel free to let us know if you have any more questions!
|
|