How to prevent a FileUpload from being cleaned when an event occurs in the form?

0

I have a fileUpload and a button as follows:

<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

Each time the Click event of the button is generated, the FileUpload is cleaned, to prevent the selected file from being deleted, I am trying to do it in the following way:

  <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:FileUpload ID="FileUpload1" runat="server" />
            </ContentTemplate>
               <Triggers>
              <asp:PostBackTrigger ControlID="Button1" />
          </Triggers>
        </asp:UpdatePanel>

        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
                <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>

I suppose I should include something that I do not know in the Code Behind at the moment it looks like this:

  Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
    If Not Me.IsPostBack Then

        ' Código

    End If
End Sub
    
asked by yulfredy rodriguez 17.11.2017 в 00:28
source

0 answers