Your code is correct only. As I guessed, you have taken your file upload control inside the update panel(You can see the same situation
here[
^]). Remove the update panel and check it again.
Alternative solution:
Add a trigger for
UpdatePanel
:
<triggers>
<asp:postbacktrigger controlid="btnCertificateUpload" />
</triggers>
This will force a postback when the upload button is clicked.
After that add the below line to the
Page_Load
:
Page.Form.Attributes.Add("enctype", "multipart/form-data");
Hope it helps.!
--Amit