使用Ajax进行文件上传控制 [英] fileupload control with ajax

查看:83
本文介绍了使用Ajax进行文件上传控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在aspx页面中使用ajax选项卡控件.
在该控件中,我正在使用fileupload控件上传图像.
但是fileupload控件无法获取任何文件.

I am using ajax tab control in aspx page.
In that control i am using fileupload control to upload the image.
but fileupload control is not able to get any file.

if(fileupload1.hasfile==true)
{
string f=filupload1.filename.tostiring();
string fpath="~/image/image/"+f;
fileupload1.saveas(mappath(fpath));
}


但它无法获取文件.
所以在if条件下会出现错误.

谁能帮帮我.


but it doesnot able take file.
so m getting error in if condition.

can any one help me out.
thankx in advance.

推荐答案

您不能直接在更新面板中使用文件上载控件上载文件.

请参阅此处的链接.

http://aspalliance.com/1442_Building_AJAX_Enabled_File_Uploading_System_with_Progress_Bar_Using_ASP_UP_ing_ASP_UP_A_________NET_Alt_Alt_Alt_A______NET_ALP_AJ____NET_20._ "target =" _ blank"title ="新窗口> ^ ]

或者您可以使用一些第三方api.

http://ajaxuploader.com/ [ ^ ]
You can''t upload file with file upload control in update panel directly.

refer the links here.

http://aspalliance.com/1442_Building_AJAX_Enabled_File_Uploading_System_with_Progress_Bar_Using_ASPNET_20.all[^]

or you can use some third party api.

http://ajaxuploader.com/[^]


文件上传将需要完整的回发.

试试:
回传更新面板的触发器
File upload will need full postback to work on.

Try:
Post back trigger for the update panel
<asp:PostBackTrigger ControlID="fileupload1" />


这篇关于使用Ajax进行文件上传控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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