title: File upload control not working inside Update panel even after postback trigger
body: <p>i am facing strange issue: File upload is not working inside update panel. I know this is common issue, however common solutions are not working here.
  i.e. I have tried using post-back trigger for upload button.</p>
  
  <p>Code is like: </p>
  
  <pre><code>&lt;asp:UpdatePanel runat="server"&gt;
                  &lt;ContentTemplate&gt;
                      &lt;div runat="server" id="divAttachments" style="margin-top: 10px;"&gt;
                          &lt;div class="attachment collapsableDiv" onclick="HideShowAttachments();" style="margin-left: auto;
                              margin-right: auto;"&gt;
                              &lt;img id="imgStatusMain" src="../Images/open.gif" class="showHide rightImage" runat="server" /&gt;&amp;nbsp;
                              Attachments &lt;span class="mandatory"&gt;*&lt;/span&gt;
                          &lt;/div&gt;
                          &lt;div id="attachmentDiv" style="margin-left: auto; margin-right: auto;"&gt;
                              &lt;asp:GridView runat="server" ID="gvAttachments" CssClass="innerGrid" EmptyDataText="No attachments added"
                                  DataKeyNames="Id" AutoGenerateColumns="false" OnRowDataBound="gvAttachments_RowDataBound"
                                  OnRowCommand="gvAttachments_RowCommand"&gt;
                                  &lt;Columns&gt;
                                      &lt;asp:TemplateField HeaderText="File name"&gt;
                                          &lt;ItemTemplate&gt;
                                           &lt;asp:LinkButton
                                                  runat="server" ID="gvlblFileName" Text='&lt;%#Eval("FileName") %&gt;' OnClick="gvlblFileName_Click"&gt;&lt;/asp:LinkButton&gt;
                                              &lt;asp:HiddenField runat="server" ID="hfFileName" Value='&lt;%#Eval("Id") %&gt;' /&gt;
                                          &lt;/ItemTemplate&gt;
                                      &lt;/asp:TemplateField&gt;
                                      &lt;asp:TemplateField HeaderText="Action"&gt;
                                          &lt;ItemTemplate&gt;
                                              &lt;asp:LinkButton ID="lbtnDelete" runat="server" CausesValidation="False" CommandName="remove"
                                                  Text="Delete" ToolTip="Click to delete" CommandArgument='&lt;%# DataBinder.Eval(Container, "RowIndex") %&gt;'&gt;&lt;/asp:LinkButton&gt;
                                          &lt;/ItemTemplate&gt;
                                          &lt;ItemStyle CssClass="action" /&gt;
                                      &lt;/asp:TemplateField&gt;
                                  &lt;/Columns&gt;
                              &lt;/asp:GridView&gt;
                              &lt;span class="label" runat="server" id="spnAttachments" style="margin: 10px 10px 10px 50px;"&gt;
                                  Attachments&lt;/span&gt;
                              &lt;asp:FileUpload runat="server" ID="fuAttachements" onchange="UploadFile();" Style="margin: 10px 0px 10px 0px;" /&gt;&lt;asp:LinkButton
                                  runat="server" ID="lbUploadFile" OnClick="lbUploadFile_Click"&gt;&lt;/asp:LinkButton&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/ContentTemplate&gt;
                  &lt;Triggers&gt;
                      &lt;asp:AsyncPostBackTrigger ControlID="ddlCategory" EventName="SelectedIndexChanged" /&gt; 
                      &lt;asp:PostBackTrigger ControlID="lbUploadFile" /&gt;
                  &lt;/Triggers&gt;
              &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>And my cs code is like:</p>
  
  <pre><code>if (string.IsNullOrEmpty(fuAttachements.FileName))
          result.AddError("Please give valid file name.");
      else
      { //code goes here}
  </code></pre>
  
  <p>I always get blank file name</p>
  
  <p>Is there any other solution for this?. I can not remove update panel.</p>
  
  <p>I have searched on Google and have checked lots of links, but everywhere same solution is given </p>