UpdateProgress and FileUpload

Posted by Krishnasamy2008 under ASP.NET on 8/8/2011 | Points: 10 | Views : 4746 | Status : [Member] | Replies : 2
Hi,

I am facing this issue for quite some time. I am not able to use updateprogress properly with fileupload control. My design page code is :
Collapse | Copy Code
<asp:ScriptManager ID="scriptMgr" runat="server" />
<asp:UpdateProgress runat="server" id="PageUpdateProgress">
<progresstemplate>
Loading...<img border="0" src="Images/loading.gif" alt="loading" style="z-index: 1100;" />
</progresstemplate>
</asp:UpdateProgress>


<asp:UpdatePanel ID="updatePnl" runat="server">
<contenttemplate>
<table cellpadding="0" cellspacing="0" width="800px" border="0" align="center" class="description">
<tr>
<td width="70%">
<asp:FileUpload Width="250px" CssClass="field" ID="fileUploadText" runat="server">;
</td>
</tr>
<tr class="alt">
<td valign="top" colspan="2">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="60%" align="right">
&lt;asp:Button ID="btnSubmit" runat="server" Text="Submit"
CssClass="button" onclick="btnSubmit_Click" >;
</td>
</tr>
</table>
</td>
</tr>
</table>
</contenttemplate>
<triggers>
<asp:PostBackTrigger ControlID="btnSubmit"/>
</triggers>
</asp:UpdatePanel>



Code behind:
---------------
protected void btnSubmit_Click(object sender, EventArgs e)
{
string filePath = Server.MapPath("Input File/" + fileUploadText.FileName);
fileUploadText.PostedFile.SaveAs(filePath);
System.Threading.Thread.Sleep(5000);
}


Thanks and Regards,
Krishna.K




Responses

Posted by: Sundarsingh57 on: 8/8/2011 [Member] Starter | Points: 25

Up
0
Down
Place the update progress tag inside the update panel. Every updatepanel can have seperate updateprogress

Jai Hind

Krishnasamy2008, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kunalverma31 on: 8/16/2011 [Member] Starter | Points: 25

Up
0
Down
I was facing similar issue, I resolved it by placing file upload control outside update panel. I hope if your requirement permit this would be easier way to solve this problem.

Krishnasamy2008, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response