Welcome Guest Search | Active Topics | Sign In | Register

Issues using Progress Bar with Ajax Options
gpcdm
Posted: Sunday, June 15, 2008 3:46:30 PM
Rank: Newbie
Groups: Member

Joined: 6/15/2008
Posts: 3
I'm using the Progress Bar, which works great, with the exception that after the task has compeleted I can't seem to get any Ajax Update Panels to update anymore.

Specficially, I have an update panel that shows the status of work done on a set of files. Prior to putting the Progress Bar on the form, and just running the task on the OnClick event fo a button, at teh end a listing of the status for each file was displayed using test output to a Literal control within the update panel.

Now, however, that doesn't work.

I've tried a variety of configurations, with multiple different Update Panels nested, not nested, all in one Panel, etc. I've tried called Update() in code after all of the processing is done. Nothing works.

Suggestions?
eo_support
Posted: Sunday, June 15, 2008 3:56:44 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,096
Hi,

It would be hard for us to shoot in the dark for issues like this. Can you isolate the problem into a separate test page that demonstrates the problem? Make sure the test page runs because most likely we will need to run and debug into it.

Thanks
gpcdm
Posted: Sunday, June 15, 2008 4:50:48 PM
Rank: Newbie
Groups: Member

Joined: 6/15/2008
Posts: 3
I accidently setup this up with the codein a separate file, but here is the code for a sampel progect. Let me know if there is something else that you need. For this, bascially if you press the Test button it will update the Literal with the values in the List Box. When you press Start it should do the same thing in red, but it doesn't.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ListBox ID="lbItems" runat="server">
<asp:ListItem>One</asp:ListItem>
<asp:ListItem>Two</asp:ListItem>
<asp:ListItem>Three</asp:ListItem>
<asp:ListItem>Four</asp:ListItem>
</asp:ListBox><br />
<br />
&nbsp;<asp:Button ID="btnTest" runat="server" OnClick="btnTest_Click" Text="Test" />
<asp:Button ID="btnStart" runat="server" Text="Start" />&nbsp;<asp:Button ID="btnStop"
runat="server" Text="Cancel" /><br />
<br />
<eo:ProgressBar ID="pbTest" runat="server" BorderColor="Black" BorderStyle="Solid"
BorderWidth="1px" ControlSkinID="None" Height="16px" IndicatorColor="LightBlue"
Maximum="4" OnRunTask="pbTest_RunTask" ShowPercentage="True" StartTaskButton="btnStart"
StopTaskButton="btnStop" Width="250px" />
<br />
<div>
<div style="border-right: slategray thin solid; padding-right: 5px; border-top: lightsteelblue thin solid;
padding-left: 5px; font-weight: bold; padding-bottom: 1px; border-left: lightsteelblue thin solid;
color: white; padding-top: 1px; background-color: steelblue; text-align: left">
Results</div>
<div>
<asp:Literal ID="lTest" runat="server"></asp:Literal>&nbsp;</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void btnTest_Click(object sender, EventArgs e)
{
foreach (ListItem item in lbItems.Items)
{
lTest.Text += item.Text+"</br>";
}
}

protected void pbTest_RunTask(object sender, EO.Web.ProgressTaskEventArgs e)
{
lTest.Text = String.Empty;

foreach (ListItem item in lbItems.Items)
{
if (e.IsStopped)
break;

lTest.Text += "<font color=red>"+item.Text+"</font> </br>";

e.UpdateProgress(e.Value + 1);
}
}
}
eo_support
Posted: Sunday, June 15, 2008 5:16:48 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,096
I see what you mean. It never will. Please see the comment in the source code tab of the sample code for more details:

http://essentialobjects.com/Demo/Default.aspx?path=ProgressBar\_i2

Thanks
gpcdm
Posted: Sunday, June 15, 2008 7:06:56 PM
Rank: Newbie
Groups: Member

Joined: 6/15/2008
Posts: 3
Got it. Thanks. One additional question. It seems that within the RunTask event you can't change the Maximum value of the Progress Bar. Is there some way to do this, so that witin the RunTask event I can get the count of how many Items I'm going to be working on an then set the Max to that number? Thank you.
eo_support
Posted: Sunday, June 15, 2008 7:22:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,096
No. RunTask is for what it is and nothing else.

You don't need to change the ProgressBar's Maximum to show the correct value. You can just set the Maximum as 100 and then call UpdateProgress((int)(current_item * 100 / total_items)).

Thanks


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.