Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

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:

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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • 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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(