FileUpload1.HasFile is always returning false

前端 未结 3 1920
闹比i
闹比i 2021-01-14 05:34

I am uploading file using ASP.net File upload control. My FileUpload1.HasFile is always returning false.

if (FileUpload1.HasFile)
        {
            DBOpe         


        
3条回答
  •  灰色年华
    2021-01-14 06:17

    Add a trigger for your UpdatePanel

     
        
     
    

    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"); 
    

提交回复
热议问题