Uploadify not working with ASP.NET WebForms
- by João Guilherme
Hi ! I'm trying to use Uploadify in a ASP.NET webforms project. The problem is that my script is not calling the generic handler. Here is the script.
<input id="fileInput" name="fileInput" type="file" />
<script type="text/javascript">
$(document).ready(function() {
$('#fileInput').uploadify({
'uploader': '/Ferramenta/Comum/Uploadify/uploadify.swf',
'script': 'UploadTest.ashx',
'cancelImg': '/Ferramenta/Comum/Uploadify/cancel.png',
'folder': "/Ferramenta/Geral/",
'auto': true,
'onError': function(event, queueID, fileObj, errorObj) {
alert('error');
},
'onComplete': function(event, queueID, fileObj, response, data) {
alert('complete');
},
'buttonText' : 'Buscar Arquivos'
});
});
</script>
This is the code of the generic handler (just to test)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.IO;
namespace Tree.Ferramenta.Geral
{
public class UploadTest : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.Write("1");
}
public bool IsReusable
{
get
{
return false;
}
}
}
}
Any ideas ? Thanks !