1

FileUpload在模式弹出窗口上有两个控件。第一个文件上传控件工作正常,将文件保存到服务器。但是,第二个文件上传控件与第一个完全相同,但是当它上传文件时,它被上传为损坏的 0 字节。任何想法可能会发生什么?此外,我的更新面板上有一个触发器,它解决了在更新面板中设置上传控件的问题。

我的asp和c#很简单

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

这是后面的代码

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

1 回答 1

0

与 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 它在​​更新面板中使用时将始终返回 false。

于 2014-04-06T19:14:01.070 回答