在AJAX的UpdatePanel文件上传不完整的回传 [英] File uploading in AJAX updatepanel without full postback

查看:228
本文介绍了在AJAX的UpdatePanel文件上传不完整的回传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个更新面板,在更新面板我已经FileUpload控件和按钮控制,在按一下按钮,我需要的,我已经上传在UpdatePanel中FileUpload控件文件。

I have a update panel, in the update panel I have fileupload control and button control, On button click, I need the file that I have upload in the fileupload control in updatepanel.

确切的情况,我有8个标签页,每个标签包含了太多的信息,其中一个选项卡中的附件,当添加显示新的附件模式弹出用户点击,模态包含DetailsView控件中的UpdatePanel,并在DetailsView我有文件上传控制,当用户点击保存按钮, DetailsView控件插入事件解雇,在插入情况下,我需要,我有上传文件。
请注意,我的页面比较重,我不想完全回发。

Exact scenario, I have 8 tabs on page, each tab contains too much information, One of the tab is Attachment, when user click on Add New Attachment Modal Popup shown, Modal contains detailsview in Updatepanel and in the detailsview I have fileupload control, when user hit save button, detailsview inserting event fired, In the inserting event I need the file that I have upload.
Please Note, My page is heavy and I don't want full postBack.


有没有人有这个问题的解决方案?


Does anyone have solution of this issue?

提前感谢你的帮助......

Advance thanks for your kind help.....

推荐答案

有关解决这一问题,请看下面的步骤。

For solve this problem, Please see the following step.

  1. 添加AJAX上传到您的详细信息视图。
    • 基于iframe上传的资源一样#1。
    • 基于Silverlight的&放大器;基于Flash的上传的我喜欢这个技术,因为它不需要用于显示当前上传状态的任何服务器端脚本。但在HTML5中,你可以创建此不使用任何网络浏览器插件。
    • 商业上传类似资源#2。的使用隐藏的iframe上传
  1. Add ajax-upload to your detail view.
    • iframe-based uploader like Resource#1.
    • Silverlight-based & Flash-based uploader. I like this technique because it doesn't require any server-side script for display current upload status. But in HTML5, you can create this without using any web browser plug-in.
    • Commercial uploader like Resource#2. that use hidden iframe for uploading.

上传文件到临时位置。

  • 系统响应的临时位置。的下一步,客户保持隐藏输入具体的形式临时位置。
  • *保持临时位置与session_id的。*您可以将其存储在数据库或会话变量取决于你的框架。
  • System response the temporary location. Next, client keep temporary location in hidden input in detail form.
  • *Keep temporary location with session_id.* You can store it in database or Session variable depend on your framework.

当你点击保存按钮,系统将文件移动到自己的真实位置

When you click on the save button, the system will move the files to their real location

请注意。系统会自动从临时位置删除过期文件。

Note. System will automatically delete the expired file from the temporary location.

资源

  1. ASP.NET文件上传用的实时的进度条
  2. ASP.NET文件上传,如Gmail(商业)
  1. ASP.NET File Upload with Real-Time Progress Bar
  2. ASP.NET File Upload like GMail (Commercial)

更新

近一年后,我才发现了一个伟大第三届缔约方控制了这个问题。这是一个开放的插件的jQuery的来源。这名Plupload,允许你上传使用HTML5,Silverlight的,Flash或普通形式的文件,它提供了一些独特的功能,如上传进度,调整图像大小和分块上传。

After almost one year, I just found a great 3rd-parties control for this question. This is an open source plug-in of jQuery. It name Plupload that allows you to upload files using HTML5, Silverlight, Flash or normal forms and it provide some unique features such as upload progress, image resizing and chunked uploads.

你可以试着和放大器;测试Plupload通过点击这里。

这篇关于在AJAX的UpdatePanel文件上传不完整的回传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆