Welcome Guest Search | Active Topics | Sign In | Register

Progress bar does not update control values Options
Sujata
Posted: Wednesday, July 2, 2008 5:24:32 AM
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?
eo_support
Posted: Wednesday, July 2, 2008 6:15:57 AM
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
Sujata
Posted: Wednesday, July 2, 2008 9:36:35 AM
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....
eo_support
Posted: Wednesday, July 2, 2008 9:41:16 AM
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\_i2

You will want to read the comment. Not the code.

Thanks!
Sujata
Posted: Wednesday, July 2, 2008 12:27:37 PM
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.
eo_support
Posted: Wednesday, July 2, 2008 12:31:09 PM
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!


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.