Last post May 28, 2017 10:48 PM by GeorgeClass
May 26, 2017 06:22 AM|GeorgeClass|LINK
I need to use two different FileUpload controls in one webform in order to select two different mandatory files with different extensions.
When I click the submit button it only sends the file from the first control, the second control returns an error like if the user never selected a file.
<asp:FileUpload ID="X1" runat="server" AllowMultiple="False" />
<asp:FileUpload ID="X2" runat="server" AllowMultiple="False" />
If X1.HasFile Then '<----OK
If X2.HasFile Then '<----Returns False
Any ideas what I am missing?
May 26, 2017 08:59 AM|kaushalparik27|LINK
That is not an expected behavior. Are you trying to get files from both FileUpload in a single button click? Because as soon as postback occurs the file will be posted to server and removed from FileUpload control. So, both Files would be available when
you click submit button for the first time. Also, make sure any of FileUpload control is not inside UpdatePanel; since it won't work with it.
May 28, 2017 09:15 PM|GeorgeClass|LINK
I am using just one button to submit files selected in both FileUpload controls and I am not using UpdatePanels, any ideas?
May 28, 2017 10:48 PM|GeorgeClass|LINK
I figured out using this example:
Thanks EVERYBODY for your help!!!