Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

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?


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

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


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(