How to call a view of Nop.Web from my custom plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 year ago
i am using a data tables in my plugin and wants to call table.cshtml  view, from the Nop.web  inside the partial helper class

  @await Html.PartialAsync("../../../Presentation/Nop.Web/Areas/Admin/Views/Shared/Table.cshtml", new DataTablesModel


getting error
InvalidOperationException: The partial view '../../../Presentation/Nop.Web/Areas/Admin/Views/Shared/Table.cshtml' was not found. The following locations were searched: /Presentation/Nop.Web/Areas/Admin/Views/Shared/Table.cshtml
1 year ago
are you working for admin side of your plugin? data table only work for admin side by default
you can check any existing admin table gird

@await Html.PartialAsync("Table", gridModel)
1 year ago
i am getting this error  if i used this

 @await Html.PartialAsync("Table", gridmodel)


InvalidOperationException: The partial view 'Table' was not found. The following locations were searched:
/Themes/DefaultClean/Views/ShoppingCart/Table.cshtml
/Themes/DefaultClean/Views/Shared/Table.cshtml
/Views/ShoppingCart/Table.cshtml
/Views/Shared/Table.cshtml
/Pages/Shared/Table.cshtml
1 year ago
have you added reference of nop.web and Nop.Web.Framework project into your plugin?
Original link https://www.nopcommerce.com/en/boards/topic/71013/why-nop-420-pluging-datatable-is-not-working-
1 year ago
view is not called from any controller
data tables view present in this  IViewComponentResult

[ViewComponent(Name = "HelloWorldWidget")]
    public class MachineSerialViewComponent: NopViewComponent
    {
        public IViewComponentResult Invoke(string widgetZone, object additionalData)
        {
            return View("~/Plugins/Widgets.MachineSerial/Views/WidgetComponentView.cshtml");
        }
    }
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.