'How to Bind file upload excel data table to Html.DevExtreme().DataGrid asp.net core mvc devexpress

I am very new to this MVC and devexpress controls, kindly help even if it is basic question.

I have "Html.DevExtreme().DataGrid" in View, and this grid is populated with data which is loaded from DB using Get Action method from controller which is working as expected.

[HttpGet]
    public  JsonResult Get(DataSourceLoadOptions loadOptions) {
         dt = GetDBData();
         List<person>   listdata = ConvertToList<person>(dt);
        }            return Json(DataSourceLoader.Load(listdata , loadOptions));
           }

And I have fileupload control(below code snippet) which is used to load excel sheet and need to show on the same grid by using TempData["FileUploadData"] in Get Action method, but failing to display the data on the grid, it is displaying plain Json text on screen.

> [HttpPost]
>        public ActionResult uploader(IFormFile File)
>        {
>        dt= loadFromExcelSheet();
>         TempData["FileUploadData"]= JsonConvert.SerializeObject(dt);
>          return RedirectToAction("Get");
>        }

but it is displaying like this enter image description here

Not getting where I am doing it wrong, kindly help.

Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source