Hi,
I'm looking to use the Kendo Upload control to Import vCards onto a Contact Creation page. Since I want to return a PartialView, and populate a Div's .html attribute, I'd like to do this as a jQuery Post like I've outlined below:
My issue is that I am constantly getting a null object when posting to /Contacts/UploadContact using jQuery.
Is there any way to pass the entire file list (including FileStream) back to the controller from jQuery like I've outlined in the "onUpload" method?
Any help would be greatly appreciated.
Thanks,
Landon
I'm looking to use the Kendo Upload control to Import vCards onto a Contact Creation page. Since I want to return a PartialView, and populate a Div's .html attribute, I'd like to do this as a jQuery Post like I've outlined below:
@(Html.Kendo().Upload()
.Name("vCard")
.Async(a => a
.Save("UploadContact", "Contacts") /*Don't really need this if I can post via jQuery */
.AutoUpload(true)
)
.Events(events => events
.Select("onSelect")
.Upload("onUpload")
)
.ShowFileList(false)
.Multiple(false)
)
function
onUpload(e) {
var
upload = $(
"#vCard"
).data(
"kendoUpload"
);
var
files = upload.files;
var
serialized =
"vCard="
+ files;
$.post(
"/Contacts/UploadContact/"
, serialized,
function
(returnHtml) {
//alert(returnHtml);
$(
"#ContactContainer"
).html(returnHtml);
});
Is there any way to pass the entire file list (including FileStream) back to the controller from jQuery like I've outlined in the "onUpload" method?
Any help would be greatly appreciated.
Thanks,
Landon