1

FileUploadモーダル ポップアップに2 つのコントロールがあります。最初の fileupload コントロールは、ファイルをサーバーに保存して正常に動作します。ただし、2 番目のファイル アップロード コントロールは最初のファイル アップロード コントロールとまったく同じですが、ファイルをアップロードすると、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);
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 を確認してください。updatepanel で使用している間は、常に false が返されます。

于 2014-04-06T19:14:01.070 に答える