First of all I am new to Kendo Uploder. I have a kendo Uploader in my page . I don't know what I am doing wrong as it didn't hit my VB Method.
Markup :
<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 Method:
''' <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
Problem: In the front end when I drag the files . Files description comes properly according to the template. But the VB method never gets hit. I am quite new to this so may be my VB or script code is wrong . Kindly guide me.
Any Help will be highly appreciated.