Welcome Guest Search | Active Topics | Sign In | Register

asp:fileupload and ProcessBar Options
Lee
Posted: Wednesday, March 18, 2009 2:01:24 PM
Rank: Newbie
Groups: Member

Joined: 3/18/2009
Posts: 1
Hi,

I am new to the ProcessBar control. I am trying to build a very simple application, which will upload a file, extract the file content and load it to the database. I thought it is good idea to have a process bar to indicate the loading process.

The problem I have is that the ProgressBar1_RunTask event does not fire if I upload a file to any FileUpload 'Brows...' or have any text in the textbox.

Could you help me out?

Thanks in advance,

Lee


Below is part of the client code:
====================
<div style="text-align: center">
<br />
<br />
<div id="divProcessBar" style="text-align: center">
<eo:ProgressBar ID="ProgressBar1" runat="server" Width="550px" Height="10px" OnRunTask="ProgressBar1_RunTask"
StartTaskButton="btnStartLoading" StopTaskButton="btnStopLoading" BorderColor="LightSkyBlue"
IndicatorColor="White" BorderStyle="Double" BackColor="White" IndicatorImage="00060104" IndicatorIncrement="10" ShowPercentage="True" OnPreRender="Page_Load">
</eo:ProgressBar>
</div>
<br />
<br />
<%-- <asp:UpdatePanel ID="UpadatePanel1" runat="server">
<ContentTemplate--%>
<div id="divLoadFile" style="text-align: center">
<table width="85%">
<tr>
<td align="right">
<asp:Label ID="lblDesignWinDataFile" Text="Design Win Data File:" CssClass="label"
runat="server"></asp:Label></td>
<td align="left">
<asp:FileUpload ID="fileUploadDesignWinDataFile" Width="500px" CssClass="frmInput"
runat="server" /></td>
</tr>
<tr>
<td align="right">
<asp:Label ID="lblHarnessMfgToCompanyDataFile" Text="HarnessMfg To Company Data File:"
CssClass="label" runat="server"></asp:Label></td>
<td align="left">
<asp:FileUpload ID="fileUploadHarnessMfgToCompanyDataFile" Width="500px" CssClass="frmInput"
runat="server" /></td>
</tr>
<tr>
<td align="right">
<asp:Label ID="lblCustomerToParentDataFile" Text="Customer To Parent Data File:"
CssClass="label" runat="server"></asp:Label></td>
<td align="left">
<asp:FileUpload ID="fileUploadCustomerToParentDataFile" Width="500px" CssClass="frmInput"
runat="server" /></td>
</tr>
</table>
</div>
<br />
<br />
<div id="divStartStop">
<table width="58%">
<tr>
<td align="right">
<asp:Button ID="btnStartLoading" runat="server" Text="Start Loading" />&nbsp;&nbsp;
<asp:Button ID="btnStopLoading" runat="server" Text="Stop Loading" />
</td>
</tr>
</table>
</div>
<div id="divMessage">
<asp:Label ID="lblMessage" runat="server"></asp:Label></div>
<%-- </ContentTemplate>
</asp:UpdatePanel>--%>
</div>


Below is the part of the server code:
========================
protected void Page_Load(object sender, EventArgs e)
{

}

#endregion

#region Events

protected void ScriptManager1_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
{
ScriptManager1.AsyncPostBackErrorMessage = e.Exception.Message + e.Exception.StackTrace;
}

protected void ProgressBar1_RunTask(object sender, EO.Web.ProgressTaskEventArgs e)
{
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.
System.Threading.Thread.Sleep(500);

//You should frequently call UpdateProgress in order
//to notify the client about the current progress
e.UpdateProgress(i);
}

e.UpdateProgress(100);
lblMessage.Text = "Complete";
}
eo_support
Posted: Wednesday, March 18, 2009 2:11:09 PM
Rank: Administration
Groups: Administration

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

We won't be able to provide support for such questions because we have an AJAXUploader control that does exactly what you wanted to do. Also we generally do not offer technical assistant on our free products. Sorry about that!

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.