Welcome Guest Search | Active Topics | Sign In | Register

ProgressBar - ASP.NET page does not rerender after a postback Options
Naram Qashat
Posted: Wednesday, April 20, 2011 4:23:56 PM
Rank: Newbie
Groups: Member

Joined: 4/20/2011
Posts: 2
I am using EO's ProgressBar on one of my ASP.NET pages, and would like to have the page do a postback when I have signaled that the OnRunTask method is complete. I added code to the Javascript ClientSideOnValueChanged function that tries to run __doPostBack with another control's UniqueID and optional some arguments. I have at least 2 panels on the page and the EO ProgressBar is within one of those panels. The ProgressBar is started via Javascript as I wanted it to start on the page load and not on a button press.

In IE, the postback fires and I can see that the page's Page_Load is called, but the page does not rerender at all, even if I set the panel of the ProgressBar to not be visible and have another panel be visible.

Firefox doesn't even seem to react to a normal __doPostBack at all (Firebug shows that the script of the page has been completely overwritten by EO's ProgressBar), and while it does fire the postback if I utilize a cross-page postback instead, the new page does not get rendered by the browser (and the URL stays on the current page, not the new page).

A simplified example:

.aspx:

<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyPlaceHolder" runat="server">
<script type="text/javascript">
function OnValueChanged(progressBar)
{
var extraData = progressBar.getExtraData();
if (extraData == "Done!")
__doPostBack('someControl', '');
}
</script>
<asp:Panel ID="pnlPanel" runat="server">
<asp:Label ID="lblLabel" runat="server" />
<eo:ProgressBar ID="eoProgressBar" runat="server" Width="300" IndicatorColor="Blue" ShowPercentage="true" ControlSkinID="Traditional"
ClientSideOnValueChanged="OnValueChanged" OnRunTask="eoProgressBar_OnRunTask" />
</asp:Panel>
<asp:Panel ID="pnlOtherPanel" runat="server" Visible="false">
Done!
</asp:Panel>
</asp:Content>

.cs:

using System;
using System.Web.UI;
using EO.Web;

public partial class EOTest : Page
{
protected void Page_Load(object sender, EventArgs e)
{
string eventTarget = this.Request.Params["__EVENTTARGET"] ?? "";
if (eventTarget == "someControl")
{
this.pnlPanel.Visible = true;
this.pnlOtherPanel.Visible = false;
}
else if (eventTarget != this.eoProgressBar.UniqueID)
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "EOLoad", this.eoProgressBar.ClientID + ".startTask()", true);
}

protected void eoProgressBar_OnRunTask(object sender, ProgressTaskEventArgs e)
{
e.UpdateProgress(100, "Done!");
}
}

When this is run, it will do 2 postbacks (one for the initial load and one for the ProgressBar), then it will go to the OnRunTask event. In IE, the 3rd postback will correctly fire, but the page itself does not rerender. In Firefox, the 3rd postback never happens. If I replace __doPostBack in the Javascript with WebForm_DoPostBackWithOptions (requires me to add a control that does a cross-page postback), then Firefox will fire the 3rd postback (to the other page) but the page won't render.
eo_support
Posted: Wednesday, April 20, 2011 4:33:17 PM
Rank: Administration
Groups: Administration

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

Try to use setTimeout to delay your __doPostBack and see if it helps:

Code: JavaScript
setTimeout(
    function()
    {
        __doPostBack('someControl', '');
    }, 100);


Please note that officially we only provide free tech support to progress bar control unless you have a license for any of our product (because the progress bar control itself is free). So if you still have any questions, please consider purchase a license for any of our product. Any license would cover free tech support for all products for one year.

Thanks!
Naram Qashat
Posted: Wednesday, April 20, 2011 4:47:18 PM
Rank: Newbie
Groups: Member

Joined: 4/20/2011
Posts: 2
That only fixes the issue with Firefox not posting back. I understand that you only provide free tech support without a license, but does EO's ProgressBar even support using the default ASP.NET __doPostBack to force a full postback? From what I can see, it doesn't seem to allow me to do that, as the browsers are not handling this correctly. I can see the request sent to the server through the Firefox add-on Live HTTP Headers.
eo_support
Posted: Wednesday, April 20, 2011 5:06:17 PM
Rank: Administration
Groups: Administration

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

There should be no issue with __doPostBack with ProgressBar control. If that was the case then a lot of ASP.NET pages with our ProgressBar in would break because most server controls relies on __doPostBack to function. Obviously that is not the case.

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.