I am working on a custom ASP.Net element. In my control, I have a FileUpload control inside a MultiView inside an AJAX UpdatePanel.
I added a submit button to the update panel feedback triggers. (This is the standard patch for FileUpload in UpdatePanel).
The first time FileUpload is sent, it does not load anything (i.e., the FileBytes property of the control is zero length). Everything else in the form is sent correctly.
In the second and subsequent representations, loading is performed correctly.
What could be the reason for this and how to fix it?
For example:
<asp:UpdatePanel runat="server" ID="update_panel" UpdateMode="Conditional">
<ContentTemplate>
<asp:MultiView runat="server" ID="mvMultiView" ActiveViewIndex="0">
<asp:View runat="server" ID="viewOne">
</asp:View>
<asp:View runat="server" ID="viewTwo">
<asp:FileUpload ID="file_upload" runat="server" />
<asp:Button ID="save_button" runat="server" Text="Save" OnClick="save_Click" ValidationGroup="group" />
</asp:View>
</asp:MultiView>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="save_button" />
</Triggers>
</ajax:UpdatePanel>
source
share