Jump to content

Photo

How To Display Popup from a Plugin

Display Popup from a Plugin

  • Please log in to reply
1 reply to this topic

#1 nitware

nitware

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 26 November 2017 - 14:24

Hello team,

 

I want to display popup from a plugin. I referenced the popup layout page with the code below from my plugin view.

 @{
     Layout = "~/Administration/Views/Shared/Layouts/_AdminPopupLayout.cshtml";
  }

The above code throws the below exception:

The layout page "_AdminRoot" could not be found at the following path: "~/Administration/Views/Shared/Layouts/_AdminRoot".

How do I resolve this?

 

Thanks in advance for your assistance.


  • SalehBagheri likes this

#2 SalehBagheri

SalehBagheri

    Advanced Member

  • Members
  • PipPipPip
  • 31 posts

Posted 31 May 2018 - 01:05

You can use [AdminThemed] action filter in your plugin controller!

[AdminThemed]
Public ActionResult YourModalOrPage()
{
     return View();
}

and in your view file:

@{
     Layout = "_AdminLayout.cshtml";
}

<h1>Hello in Admin</h1>

S Ʌ L Ξ H - B Ʌ G H Ξ R I

Microsoft Certified Professional