在asp.net中动态应用uploadify? [英] Apply uploadify dynamically in asp.net ?
本文介绍了在asp.net中动态应用uploadify?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在调用uploadify函数('#ControlName')。通过单击anchor元素uploadify()。但是jquery(...)。uploadify不是函数错误发生。我写的代码如下:
On .aspx Page
< 输入 type = file value = 上传图片 class = aReminderCreateUploadImage id = aReminderCreateUploadImage >
< / br >
< a class = aReminderCreateCancel > 取消< / a >
.js文件
$(' .aReminderCreateCancel')。live(' click',< span class =code-keyword> function (){
$( #aReminderCreateUploadImage )。uploadify({
' swf':'跨度> <跨度class =code-string> Script / uploadify.swf',
' uploader' :' Reminder.ashx',
' auto': true ,
' multi': false ,
' buttonText':' 添加照片',
' onUploadSuccess': function (文件,数据,响应){
$(' .imgReminderCreate')。attr(' src',数据);
}
,错误: function (res){
alert( 外部错误: - + res.d);
}
});
});
在aspx页面上引用了每个脚本的Uploadify.js和MyFile.js以及Uploadify的CSS。 div class =h2_lin>解决方案
(' 。aReminderCreateCancel') .live(' 点击',功能 (){
( #aReminderCreateUploadImage)。uploadify ({
' swf':' Script / uploadify.swf',
' uploader':' Reminder.ashx',
' auto': true ,
' multi': false ,
' buttonText':' 添加照片',
' < span class =code-string> onUploadSuccess': function (文件,数据,响应){
(' 。imgReminderCreate')。attr(' src',data);
}
,错误: function (res){
alert( 外部错误: - + res.d);
}
});
});
在aspx页面上引用了每个脚本的Uploadify.js和MyFile.js以及Uploadify的CSS。 / BLOCKQUOTE>
I am calling uploadify function ('#ControlName').Uploadify() by clicking on anchor element. But jquery(...).uploadify is not a function error is occuring. The code I have written is below
On .aspx Page <input type="file" value="Upload Image" class="aReminderCreateUploadImage" id="aReminderCreateUploadImage"> </br> <a class="aReminderCreateCancel">Cancel</a>
On .js File
$('.aReminderCreateCancel').live('click', function() { $("#aReminderCreateUploadImage").uploadify({ 'swf': 'Script/uploadify.swf', 'uploader': 'Reminder.ashx', 'auto': true, 'multi': false, 'buttonText': 'Add Photos', 'onUploadSuccess': function(file, data, response) { $('.imgReminderCreate').attr('src', data); } , error: function(res) { alert("Outer Error :- " + res.d); } }); });
Both Scripts Uploadify.js and MyFile.js and CSS of Uploadify are referenced on aspx page.解决方案('.aReminderCreateCancel').live('click', function() {
("#aReminderCreateUploadImage").uploadify({ 'swf': 'Script/uploadify.swf', 'uploader': 'Reminder.ashx', 'auto': true, 'multi': false, 'buttonText': 'Add Photos', 'onUploadSuccess': function(file, data, response) {
('.imgReminderCreate').attr('src', data); } , error: function(res) { alert("Outer Error :- " + res.d); } }); });
Both Scripts Uploadify.js and MyFile.js and CSS of Uploadify are referenced on aspx page.
这篇关于在asp.net中动态应用uploadify?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文