簡體   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