Vb.net – FileUpload.hasFile is always False


I have a FileUpload control (and it's not inside an UpdatePanel) and its hasFile property is always False.

   <asp:FileUpload ID="certificateUploader" runat="server"/>

Any thought?

Best Solution

Add a trigger for your UpdatePanel

   <asp:PostBackTrigger ControlID="btnCertificateUpload" />

This will force a postback when the upload button is clicked.

Also, add the line below to the Page_Load

Page.Form.Attributes.Add("enctype", "multipart/form-data");