asp:FileUpload控件第二次不工作 [英] asp:FileUpload control not working on second time
本文介绍了asp:FileUpload控件第二次不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
当我从处理程序得到响应时,Asp文件上传控件无法正常工作。第一次工作正常,当我点击文件上传时,我可以选择文件,但之后没有任何事情发生。
请帮助纠正这个问题。
Hi All,
Asp file upload control not working when i get response from handler. first time its working fine, when i clicked on file upload , i can able to select file but after that nothing happening.
please help to rectify the issue.
<asp:FileUpload runat="server" id="fleupload" />
$('#btn').click(function () {
$.ajaxFileUpload({
type: 'POST',
contentType: "application/json; charset=utf-8",
url: 'Handlers/UploadFile.ashx',
secureuri: false,
dataType: 'text',
contentType: "text/html",
data: { $('#aid').val() },
success: function (data, status) {
if (data.length > 0) {
alert(data);
}
else {
}
},
error: function (data, status, e) {
if (err.statusText.length > 0) {
alert(err.statusText);
}
}
});
}
}
推荐答案
(' #btn')。click(function(){
('#btn').click(function () {
.ajaxFileUpload({
type:' POST',
contentType: < span class =code-string> application / json; charset = utf-8,
url:' Handlers / UploadFile.ashx',
secureuri: false ,
dataType:' text',
contentType: text / html,
data:{
.ajaxFileUpload({ type: 'POST', contentType: "application/json; charset=utf-8", url: 'Handlers/UploadFile.ashx', secureuri: false, dataType: 'text', contentType: "text/html", data: {
(' #aid')。val()},
success:function(data,status){
if (data.length > 0 ){
alert(data);
}
其他 {
}
},
错误:函数(数据,状态,e){
if (err.statusText.length > 0 ){
alert(err.statusText);
}
}
});
}
}
('#aid').val() }, success: function (data, status) { if (data.length > 0) { alert(data); } else { } }, error: function (data, status, e) { if (err.statusText.length > 0) { alert(err.statusText); } } }); } }
这篇关于asp:FileUpload控件第二次不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文