繁体   English   中英

asp.net多个文件上传控件

[英]asp.net multiple file upload control

我在模式弹出窗口上有两个FileUpload控件。 第一个fileupload控件可以很好地将文件保存到服务器。 但是,第二个fileupload控件与第一个完全相同,但是当它上载文件时,它被损坏为0字节。 有什么想法会发生什么吗? 另外,我的updatepanel上有一个触发器,该触发器解决了在updatepanel内部具有上载控件的问题。

我的ASP和C#非常简单

<tr align="center">
 <td>Editable Doc</td>
  <td>
     <asp:FileUpload ID="uploadeditable" runat="server" />
  </td>
</tr>

这是背后的代码

 upload.PostedFile.SaveAs(path + "\\" + file);

与UpdatePanel控件不兼容的控件

以下ASP.NET控件与部分页面更新不兼容,因此在UpdatePanel控件内不受支持:

1. TreeView and Menu controls.

2. Web Parts controls. For more information, see ASP.NET Web Parts Controls.

3. FileUpload controls when they are used to upload files as part of an asynchronous postback.

4. GridView and DetailsView controls when their EnableSortingAndPagingCallbacks property is set to true. The default is false.

5. Login, PasswordRecovery, ChangePassword, and CreateUserWizard controls whose contents have not been converted to editable templates.

6. The Substitution control.

7. Validation controls, which includes the BaseCompareValidator, BaseValidator, CompareValidator, CustomValidator, RangeValidator, RegularExpressionValidator, RequiredFieldValidator, and ValidationSummary control.

对于您的种类信息,请检查FileUpload1.hasfile,它在updatepanel中使用时将始终返回false。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM