File upload inside update panel after postback not showing file.
I have file upload and after that 2 postback.
First is on lnkaddnew at that time i made some calculations on codebehind and on btnsave, i save it all but on click of lnkaddnew FileUpload lost file.
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<label for="">Link Expiry</label>
<asp:TextBox ID="txtLinkExpiryDate" runat="server"></asp:TextBox>
<asp:FileUpload ID="FileUpload1" CssClass="fileInput" runat="server" />
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
<ContentTemplate>
<div class="addnewo">
<asp:LinkButton ID="lnkbtnAddNew" OnClick="lnkbtnAddNew_Click" runat="server">Add New </asp:LinkButton>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnSave" />
</Triggers>
</asp:UpdatePanel>
ON Page Load i added
Page.Form.Attributes.Add("enctype", "multipart/form-data");