Ajax Toolkit AsyncFileUpload not working inside a

2019-08-01 07:11发布

Referring to the following: Ajax Asyncfileupload doesn't work as soon as I put it in a control

I am having the same issue. I am not using a Master page though. I have an AsyncFileUpload control in a Panel, within an update panel.

Any ideas as to what could be causing the issue?

1条回答
时光不老,我们不散
2楼-- · 2019-08-01 07:47

When you use AsyncFileUpload you must set the right params in the form tag, that is placed in your Page or MasterPage:

 <form id="form1" runat="server" enctype="multipart/form-data" method="post">

If you don't set the right enctype and method UploadedComplete will never fire, and you won't be able to get FileUpload.FileBytes since FileUpload.HasFile returns true only during UploadedComplete execution.

I suppose that in your page you haven't set the right enctype.

Besides, prevoius versions of AsyncFileUpload didn't work on Chrome. 2011 July version (4.1.50731.0) solved the problem.

查看更多
登录 后发表回答