hi, I am using jquery ajaxupload plugin to upload files .I have the following js on my default.aspx page
$(document).ready(function() {
/* Example 1 */
var button = $('#button1'), interval;
new AjaxUpload(button, {
action: 'upload.aspx',
name: 'myfile',
responseType:'json',
onSubmit: function(file, ext) {
// change button text, when user selects file
button.text('Uploading');
// If you want to allow uploading only 1 file at time,
// you can disable upload button
this.disable();
// Uploding -> Uploading. -> Uploading...
interval = window.setInterval(function() {
var text = button.text();
if (text.length < 13) {
button.text(text + '.');
} else {
button.text('Uploading');
}
}, 200);
},
onComplete: function(file, response) {
button.text('Upload');
window.clearInterval(interval);
// enable upload button
this.enable();
// add file to the list
$('<li></li>').appendTo('#example1 .files').text(file);
}
});
}); /*]]>*/</script>
the above js will invoke upload.aspx.cs page load.I am expecting a json response from upload.aspx.But I do not understand how do I return a response from page load.I have also tried modifying the 'action' attribute to 'upload.aspx/getdata', where 'getdata' is a method/webmethod,but I still see the page load getting invoked and not the method/webmethod.
Could someone please help me in getting a response(such as upload status(success/fail) in json) and presenting it to the UI?