FileUpload.hasFile is always False

2019-01-14 05:52发布

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?

7条回答
Fickle 薄情
2楼-- · 2019-01-14 06:33

You can try to take your button off from the UpdatePanel; As far as I get, UpdatePanels always update when something inside any other update panel updates, so if your button postback, your FileUpload control also postback and lose the file reference.

查看更多
登录 后发表回答