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);
}
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?
Hi,
You need to set layout constant inside your view.
@{
Layout = KTTheme.GetView("Default.cshtml");
}