简体   繁体   中英

FileUpload Using Ajax In ASP.NET With C#

我需要使用FileUpload上传图像而不回发(使用Ajax)。我尝试了很多例子。但是在所有回发即将到来或者他们正在使用PHP。任何人都可以帮我在ASP.Net中使用ajax进行单文件上传或多文件上传用C#。

SWFUpload

http://demo.swfupload.org/v220beta3/simpledemo/index.php

http://swfupload.org/

Javascript and Flash, there's no post-back :) and there's .NET implementations available on the site.

As the others say you can't do it completely without a postback but you can add some nice ajax functionality around the process. Steve Sanderson has written a good walkthrough here:

http://blog.codeville.net/2008/11/24/jquery-ajax-uploader-plugin-with-progress-bar/

我个人使用过这个: Ajax Uploader - 对你不自由,但相当不错。

I use Ajax Uploader too. It works great for my projects and it allows you to upload files to web server without refreshing the page.

Here is a demo page .

正如其他人所说,文件上传需要回发。在任何更新面板中,你应该将文件上传控制注册为postbackcontrol到scriptmanager。同时你可能会看到telerik上传控件以了解它应该是什么。

There is no such thing as a ajax file upload. The components that you see either use flash swfupload or a hidden iframe that they post a form to that give the impression it is happening in an ajax manner. There are many plugins avaiable to help you do this. My favourite is this that uses jquery and swfupload

There is no way you can access the contents of a file input field through JS. This is because of security concerns. Though what you CAN do is to create an iframe and from a button submit only that iframe which again can contain your file input field...

This would give the "impression" of an Ajax File Upload control...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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