i have a popup that was designed in a html page.
i need to show the message "This batch contains " + TargetCount+ " records. Please press Continue to finish importing your data.", near the buttons outside the border,where the "TargetCount" returns from controller. I have my controller like,
[HttpPost]
public JsonResult UploadFile(string id)
{
if (this.Request.Files.Count >= 1)
{
var file = Request.Files[0];
ImportFileSetting importFileData = importHandler.SaveUploadedFile(file, caseNumber, isFieldName);
return Json(importFileData.TargetCount);
}
return Json(null);
}
and i have my jquery like,
function UploadFile(event) {
sendFile(event.target.files[0]);}
function sendFile(file) {
var data = new FormData();
data.append("Uploaded", file);
var id =true;
$.ajax({
type: 'post',
url: '/Import/UploadFile?id=' + id,
data: data,
success: function (data)
{
if (data) {
var errorMessageOne = " This batch contains " + data + " records. Please press Continue to finish importing your data.";
return errorMessageOne;
}
},
});}
As iam the beginner i dont how to return this message. Kindly tell me how to achieve this.