Hi,
I want to use Kendo upload into kendow window, but I am getting issue while uploading it. Below code for kendo upload in page.
ISSUE : I am getting multiple times response in "onSuccessWnd" function and also in my controller. So that same image will display multiple times. Please me solution for same.
It is working perfectly without window.
/********************** image.cshtml page *********************/
/********************** javascript function *********************/
Please let know if any body have a solution for that.
I want to use Kendo upload into kendow window, but I am getting issue while uploading it. Below code for kendo upload in page.
ISSUE : I am getting multiple times response in "onSuccessWnd" function and also in my controller. So that same image will display multiple times. Please me solution for same.
It is working perfectly without window.
/********************** image.cshtml page *********************/
@(Html.Kendo().Upload()
.Name(
"attachments"
)
.HtmlAttributes(
new
{ id =
"FilesToUploadWnd"
, style =
"width:100%"
})
.Messages(m => m.Select(
"select files from your computer… "
))
.ShowFileList(
false
)
.Async(async => async
.Save(
"SaveWnd"
,
"Log"
)
)
.Events(e => e
.Success(
"onSuccessWnd"
)
)
)
/********************** javascript function *********************/
function
onSuccessWnd(e) {
var
url =
"../FolderName/"
+ e.response.status.toString();
var
elem = document.createElement(
"img"
);
elem.setAttribute(
"height"
,
"70"
);
elem.setAttribute(
"width"
,
"70"
);
elem.setAttribute(
"src"
, url);
document.getElementById(appendID).appendChild(elem);
}