首先,我是 Kendo Uploder 的新手。我的页面中有一个剑道上传器。我不知道我做错了什么,因为它没有击中我的 VB 方法。
标记:
<script id="fileTemplate" type="text/x-kendo-template">
<span class='k-progress'></span>
<div class='file-wrapper'>
<h4 class='file-heading file-name-heading'>Name: #=name#</h4>
<h4 class='file-heading file-size-heading'>Size: #=size# bytes</h4>
<button type='button' class='k-upload-action'></button>
</div>
</script>
<script>
$(document).ready(function () {
$("#files").kendoUpload({
multiple: true,
async: {
saveUrl: "NewFolder.aspx/UploadSubSRFiles",
removeUrl: "Remove",
autoUpload: true
},
upload: onUpload,
template: kendo.template($('#fileTemplate').html())
});
function onUpload(e) {
var paramsEmailDocs = "{'strFiles':'" + e.files + "'}"
Request.files
$.ajax({
type: "POST",
url: "NewFolder.aspx/UploadSubSRFiles",
data: paramsEmailDocs ,
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
success: function (data) {
}
})
}
});
</script>
HTML:
<div id="example" class="k-content">
<input type="file" name="files" id="files" />
</div>
VB方法:
''' <summary>
''' Method for getting the Template Service request Object
''' </summary>
''' <returns></returns>
''' <remarks></remarks>
<WebMethod()> _
Public Shared Function UploadSubSRFiles(ByVal strFiles As HttpPostedFileBase) As Boolean
Try
If lngUserID > 0 Then
Return True
Else
Return Nothing
End If
Catch ex As Exception
Debug.WriteLine("Error in UploadSubSRFiles method of Folder page: " + ex.Message)
Return Nothing
End Try
End Function
问题:在前端拖动文件时。文件描述根据模板正确出现。但是 VB 方法永远不会受到影响。我对此很陌生,所以可能是我的 VB 或脚本代码错误。请指导我。
任何帮助将不胜感激。