My records are coming back from the server in C# in this format:
(via network tab / preview on the network call)
DateModified: "/Date(1640035318903)/"
What would cause this issue? Why won't it just come back like this?
This is how I'm returning it via my controller via a post:
/// <summary>
/// Gets the application file manager file system items.
/// </summary>
/// <param name="fileManagerJsParam">The file manager js parameter.</param>
/// <returns>
/// ActionResult
/// </returns>
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<ActionResult> GetFileManagerFileSystemItems(FileManagerJsParamModel fileManagerJsParam)
{
if (fileManagerJsParam == null)
{
throw new ArgumentNullException(nameof(fileManagerJsParam));
}
if (!ModelState.IsValid)
{
return Json(new
{
success = false,
errorMessage = string.Join(
",",
ModelState.Values.Where(e => e.Errors.Count > 0)
.SelectMany(e => e.Errors)
.Select(e => e.ErrorMessage)
.ToArray())
});
}
var csModel = mapper.Map<FileManagerCsParamModel>(fileManagerJsParam);
var result = await fileManagerUtilities.GetApplicationFileManagerFileSystemItems(csModel, 107);
return Json(result.FileSystemItems);
}
Here is my javascript that calls it:
function getItemsFileManager(e) {
var deferred = $.Deferred()
let fullUrl = baseEndPoint + loadAction;
// check to see if we have different base end point / load action urls
if (e && e.dataItem) {
var fileManagerAPIItems = getFileManagerAPIItems(e.dataItem);
if (fileManagerAPIItems) {
fullUrl = fileManagerAPIItems.BaseEndPoint + fileManagerAPIItems.LoadAction;
}
}
let fileManagerJsParam = getFileManagerParams(e, true);
if (!fileManagerJsParam) {
console.log("fileManagerParms not set in getItemsFileManager @ " + new Date());
genericErrorMessage();
return;
}
$.post(BuildSafeURL(fullUrl, null), fileManagerJsParam)
.done(function (data) {
deferred.resolve(data);
})
.fail(function (error) {
deferred.reject(getItemGenericErrorMessage(e));
if (error && error.responseJSON && error.responseJSON.errorMessage) {
console.log("error⚠️", error.responseJSON.errorMessage);
}
else {
console.log("error⚠️", error);
}
});
return deferred.promise();
}