Inhalte aufrufen

Profilbild

How To Display Popup from a Plugin

Display Popup from a Plugin

  • Bitte melden Sie sich an, um eine Antwort zu verfassen.
1 Antwort zu diesem Thema

#1 nitware

nitware

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 31 Beiträge

Geschrieben: 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 gefällt das

#2 SalehBagheri

SalehBagheri

    Advanced Member

  • Members
  • PunktPunktPunkt
  • 31 Beiträge

Geschrieben: 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