Click here to Skip to main content
15,913,758 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
I Have button outside updatepanel and fileupload control inside updatepanel. When i try to upload a file FileUpload.HasFile is always false.

Thanks in Advance.
Posted
Comments
Sergey Alexandrovich Kryukov 30-Dec-14 3:43am    
This is because you never successfully upload the file. :-)
Why? Not enough information.
—SA

1 solution

please use this code in the Page_load :

C#
if(!IsPostBack)
{}


XML
Did you placed the trigger inside <update panel> like

<asp:UpdatePanel ID="UpdatePanel1"  runat="server">
  <Triggers>
    <asp:PostBackTrigger ControlID="btnUploadFile" />
  </Triggers>
 <rest of the code>
</asp:UpdatePanel>


Also You can pulled out the FileUpload control from UpdatePanel, the problem is solved.
 
Share this answer
 
v3
Comments
Praveen Kumar Upadhyay 30-Dec-14 4:52am    
Perfect solution. +5

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