FileUpload Doesn’t Work When Nested In UpdatePanel? C#
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:FileUpload onchange="clickTheButton();" ID="FileUpload1" runat="server" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" /> </Triggers> </asp:UpdatePanel> Button 1 is outside the update panel and the javascript that gets run when a user adds a file in the upload box is this: function clickTheButton() { document.getElementById('<%= Button1.ClientID %>').click(); } The problem is simple. FileUpload1.HasFile == false. … Read more