Click here to Skip to main content
15,909,051 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I amd using File upload Controll along with other Field on Form. I have Save Button on the Form as well.
When I First time Click the Save Button then textBox of File Uplaod become Empty. I raise Error in case of Empty File textBox. Please Specify File.

But When I Click Save Button Second Time. There is no issue and File Uploaded Successfully. I have used update panels in Code.
The code snippet is given below.

ASP.NET
<asp:UpdatePanel ID="pnlFileUpload" runat="server">
                <contenttemplate>
                <div id="divFileUpload"  runat="server" visible="false" >
                    <table>
                        <tr>
    <asp:UpdatePanel ID="FileUpload" runat="server">
    <contenttemplate>
    <asp:FileUpload ID="FileUpload1" EnableViewState="true"  runat="server" />
    <asp:Label ID="UploadStatusLabel" runat="server" Visible="false" SkinID="lblError">
                                </contenttemplate>
                                
                                
                            
                        </tr>
                    </table>
                
                </contenttemplate>


Any Help Please
Azhar Iqbal
Posted

1 solution

Try with this one

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AsyncFileUpload/AsyncFileUpload.aspx[^]

I'm not sure that the simple FileUpload control will work in an UpdatePanel.


Cheers!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900