我试图获得与ASP.NET一起工作的Kendo MVVM文件上载。这是我的HTML如何查找上载声明:
<input name="attachments"
id="fileUpload"
type="file"
data-role="upload"
data-async="{ saveUrl: 'FileUpload.aspx', autoUpload: true }"
data-bind="events: { success: onSuccess,error: onError }">
以及FileUpload页面加载:
Response.Expires = -1;
//Code to upload -- This returns me the file url that i need to send back as a response
Response.ContentType = "text/plain";
Response.Write(fileUrl);
Response.End();
上面写的页面加载确实按预期运行,并向我返回所需的结果,但这里的kendo控件的行为方式很有趣。它告诉我上传失败,因为错误图标显示在UI上。此外,Kendo提供的错误处理程序被执行,尽管当我尝试访问它时,写入的响应被正确返回:
e.XMLHttpRequest.responseText
嗯,我想我可能在这里或那里漏掉了什么/犯了一些小错误,但不幸的是,我无法找出同样的问题。有谁可以建议/纠正?