Lahiru Kalutotage

Lahiru Kalutotage

  • 1.3k
  • 137
  • 1.6k

file upload control in updatepanel is not working correctly

Sep 3 2024 9:26 AM

I added a file upload inside an UpdatePanel using the following code:

<asp:UpdatePanel ID="pnlUpdateMain" runat="server">
    <ContentTemplate>

        <%-- File upload + other codes here -->

    </ContentTemplate>
</asp:UpdatePanel>
 

• When I try to get the selected file name using:

if (fuLoanConfirmation.HasFile)
{
    string fileName = fuLoanConfirmation.PostedFile.FileName.ToString();
}

 

fuLoanConfirmation.HasFile always returns false.

I also set triggers for the UpdatePanel, but it still didn't work.

When I removed the UpdatePanel, it worked, but I need the UpdatePanel to be included.


Answers (1)