ASPX:
<script type="text/javascript">
$(document).ready(function () {
var uploadObj = $("#fileuploader").uploadFile({
url: "Default.aspx/UPLOAD",
fileName: "myfile",
formData: { "name": "Ravi", "age": 31 },
autoSubmit: false
});
$("#btngo").click(function (e) {
uploadObj.startUpload();
e.preventDefault();
});
});
</script>
CodeBehid
[WebMethod]
[System.Web.Script.Services.ScriptMethod]
public void UPLOAD(HttpContext context)
{
//break point not hit
}
这永远不会有效,但如果我用url: "Default.aspx/UPLOAD",
替换url: "Handler.ashx",
,它将完美无缺。是不是可以使用webmethods做同样的事情?如果没有,为什么?如果是,怎么样?