简体   繁体   中英

File missing in ajax:AsyncFileUpload on saving

I have an ajax:AsyncFileUpload on my asp file

<asp:UpdatePanel ID="modalActLogAction" runat="server" >    
      <ajax:AsyncFileUpload ID="fuActionAttachment" runat="server" Width="240px" OnClientUploadComplete = "OnClientUploadCompleteFn"/>
</asp:UpdatePanel>

The problem is when I try to access after submitting the file, its empty.

if(fuActionAttachment.HasFile)
   {
      //save statement
   }

I have tried to put enctype="multipart/form-data" method="post" on my form tag in my masterpage and still won't work. On my other pages, I do have the same file upload method and they are working properly.

File Upload dosen't work properly inside an Update Panel...This is well known issue..

Try this:

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Panel ID="pnlUploadImage" runat="server">
<asp:FileUpload ID="fuldImage" runat="server"></asp:FileUpload>


<asp:LinkButton ID="btnbUpload" runat="server" onclick="btnbUpload_Click">Add</asp:LinkButton>
</asp:Panel>


</ContentTemplate>
<Triggers>
<asp:PostBackTrigger   ControlID="btnbUpload"/></Triggers>
</asp:UpdatePanel>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM