简体   繁体   English

uplodify上传(文件上传)在更新面板中不起作用?

[英]uplodify upload (File Upload) is not working in Update Panel?

I have a aspx suppose Page1.aspx in that II am registering a web User Control suppose Page2.ascx in that same Page2.ascx I am registering an other web user control suppose Page3.ascx in which I have a file upload in which I am using Uplodifyupload for uploading multiple images. 我有一个aspx假设Page1.aspx,我正在注册一个Web用户控件,假设Page2.ascx在同一个Page2.ascx我正在注册另一个Web用户控件假设Page3.ascx我在其中有一个文件上传我在哪里使用Uplodifyupload上传多个图像。 I am keeping fileupload inside the update panel. 我在更新面板中保留fileupload。 I have a datalist on Page2.ascx i am binding all the uploaded image in datalist. 我在Page2.ascx上有一个datalist我将所有上传的图像绑定在datalist中。 datalist is also inside the update panel. datalist也在更新面板中。 when I am clicking on any item of datalist Browser button is not showing for the first time its working but after clicking on item its not even showing. 当我点击任何一个datalist时,浏览器按钮第一次没有显示它的工作但是在点击项目后它甚至没有显示。

Page3.ascs: Page3.ascs:

here I have uplodifyupload JS 这里我有uplodifyupload JS

  <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
  <ContentTemplate>
    <div>
       <asp:FileUpload ID="FileUpload1" runat="server"/>
    </div> 

  </ContentTemplate>
  </asp:UpdatePanel> 

Page2.ascx Page2.ascx

 <test:fileUpload ID="testupload" runat="server" /> // I am not keeping it in updatepanel.

how to solve my prob. 如何解决我的问题。 so that on every click browser btn can be shown and for the user page should be stable. 这样在每次点击浏览器时都可以显示btn,并且用户页面应该是稳定的。

You cannot upload files using AJAX. 您无法使用AJAX上传文件。 You will have to move the FileUpload control outside of the UpdatePanel as it interferes with the file upload attempting to send the file in the AJAX request which is not possible. 您必须将FileUpload控件移到UpdatePanel之外,因为它会干扰尝试在AJAX请求中发送文件的文件上载,这是不可能的。 When you use Uploadify, it's up to you to write the javascript that will upload the file to the server, not rely on UpdatePanel. 当您使用Uploadify时,您可以编写将文件上传到服务器的javascript,而不是依赖于UpdatePanel。 On the server you will need to have a generic ASHX handler or a dedicated ASPX page that will receive the file upload along with any additional parameters that you might need. 在服务器上,您将需要一个通用的ASHX处理程序或一个专用的ASPX页面,它将接收文件上载以及您可能需要的任何其他参数。

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

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