Metronic 8 asp .Net Core Modal Pop UP Not Displaying Properly
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: <partial name="~/Views/Image/UpsertModal2.cshtml" /> <partial name="~/Views/Partials/Modals/Image/UpsertModal2.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?
Replies (1)
Hi,
You need to set layout constant inside your view.
@{
Layout = KTTheme.GetView("Default.cshtml");
} Same as we are doing this in Views/_ViewStart.cshtml.
Regards,
Lauris Stepanovs,
Keenthemes Support Team