Reputation: 8431
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.
Upvotes: 0
Views: 294
Reputation: 13248
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>
Upvotes: 1