I must be missing some setup in scripts arrangements. I just use the starter kit of Metronic 8 asp .Net Core.
[HttpGet]
public IActionResult UpsertModal2()
{
ImageVM imageVM = new();
//do something here
return PartialView(imageVM);
// return View(_theme.getModalView("Partials", "UpsertModal2.cshtml"), model);
}
* return PartialView(imageVM);
* return PartialView(_theme.getModalView("Partials", "UpsertModal2.cshtml"), model);
- both of this shows the form but not loading the Layout I think
I added new function getModalView to accept file from other folder:
public string getModalView(string folder, string file)
{
return $"~/Views/Partials/Modals/{folder}/{file}";
}
I also include this in _Modals.cshtml:
By the way my modal is working fine when not passing to the mvc controller but I need to populate my model first before loading the modal
Please, Anyone?