简体   繁体   English

如何在ASP.NET和IE8中伪造异步(AJAX)文件上传?

[英]How to fake Asynchronous(AJAX) File Upload in ASP.NET and IE8?

Before anyone asks, I need to support IE8 for various reasons. 在有人问之前,出于各种原因,我需要支持IE8。 I've seen multiple solutions to this that stick a file upload control inside a form element and then utilise an iframe to simulate an AJAX file upload(Such as How to make Asynchronous(AJAX) File Upload using iframe? ). 我已经看到了多种解决方案,这些解决方案将文件上载控件粘贴在表单元素内,然后利用iframe模拟AJAX文件上载(例如, 如何使用iframe进行异步(AJAX)文件上载? )。 However, in a Webforms project where you cannot have multiple form tags and I don't want to post the entire page, what is the best solution? 但是,在一个Webforms项目中,您不能有多个表单标签,并且我不想张贴整个页面,最好的解决方案是什么?

Cheers 干杯

Stewart 斯图尔特

I think if I correct you on one thing you already have the answer to your problem in the link you shared. 我认为,如果我在一件事上对您进行纠正,那么您在共享链接中已经可以解决问题。

You can have only one server-side form , that does not mean you can not have a another html form on the page. 您只能有一个服务器端表单 ,这并不意味着您不能在页面上拥有另一个html表单。 Simply add one more form without runat=server tag. 只需添加一个没有runat=server标记的表单即可。

Hope this helps. 希望这可以帮助。

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

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