我正在尝试使用带有 Backload 的 jQuery File Upload 作为 ASP.NET 网站中的处理程序,但无法使其正常工作。
这是 Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE HTML>
<html>
<head runat="server">
<meta charset="utf-8">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/vendor/jquery.ui.widget.js"></script>
<script src="js/jquery.iframe-transport.js"></script>
<script src="js/jquery.fileupload.js"></script>
<script src="js/uploader.js"></script>
</head>
<body>
<input id="fileupload" type="file">
</body>
</html>
以及启用文件上传插件的js:
$(document).ready(function () {
var handlerUrl = "/Backload/FileHandler";
$('#fileupload').fileupload({
url: handlerUrl
});
});
我已经使用 NuGet 安装了 Backload,并将 jQuery File Upload 加载到我的项目中。所有引用都加载正常(控制台中没有错误)。当我尝试上传文件时出现错误:
Failed to load resource: the server responded with a status of 404 (Not Found)
,并且指出的资源是http://localhost:61076/Backload/FileHandler
.
我在这里想念什么?
注意:我没有编写任何代码。这些都是来自相关来源的复制\粘贴示例,因为我试图在实际构建自己的网站之前让一个基本的东西正常工作。