如何在不刷新整个页面的情况下使用javascript在asp.net中使用HTML文件控件上传图像文件? [英] how to upload image file using HTML File control in asp.net using javascript with out refreshing whole page?

查看:65
本文介绍了如何在不刷新整个页面的情况下使用javascript在asp.net中使用HTML文件控件上传图像文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好朋友,我有一个小的查询,我想将大小不超过100KB的图像文件上传到我的asp.net应用程序中的uploads文件夹中.我已经成功完成了ASP.Net文件上传控件,我仅上传了图像文件,并且最大文件大小不超过100KB,并且在上传后,我正在控件下方显示该图像.
到现在为止一切都很好.

但是现在我想使用HTML File Control和javascript来做到这一点,因为当我上传文件时,当我使用ASP.NEt控件时整个页面都在刷新,因此导致其他字段刷新为旧值不应该这样做.我不想使用在asp.net控件下的任何更新面板,我想使用纯HTML和javascript进行操作,并且在图像上传后可以显示该上传图像,甚至还可以删除最近上传的图像.

是否可以在不刷新页面的情况下使用Javascript上传图像.

任何帮助,请在此处发布.
谢谢
Ganesh

Hi friends, I have small query, that I want to upload image files of size not more than 100KB to uploads folder in my asp.net application. I have done successfully with ASP.Net File Upload Control that I have uploaded only image files and of max size not more than 100KB and after upload I am displaying that image below the control.
Every thing is works fine till now.

but now I want to do it with the use of HTML File Control and with javascript, because when I upload the file the whole page is refreshing when I use the ASP.NEt control, so that causes the other fields to be refreshed to old values which should not be done. I donot want to use any update panel which is under asp.net controls I want to do with pure HTML and javascript and after image upload can I show that upload image and even I want to delete the image that uploaded recently.

Is this possible that can we upload an image using Javascript without refreshing the page.

Any Help Please post over here.
Thanks
Ganesh

推荐答案

尝试使用ajax asyncfileupload控件......
try using ajax asyncfileupload control......



这篇关于如何在不刷新整个页面的情况下使用javascript在asp.net中使用HTML文件控件上传图像文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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