how to access defined htmlextension(Nop.Web.Framework) in plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 лет назад
Hi Folks,

I am developing plugin for customize vendor detail from admin dashboard.
For that I have overrided Edit action and view(Edit.cshtml, _CreateOrUpdate.cshtml) accordingly.
But I facing below issue when opening that page,
Unable to access htmlextensions like
   1. Html.SetActiveMenuItemSystemName("Vendors");
   2. @Html.DeleteConfirmation("vendor-delete")

below are the error,

CS1061: 'System.Web.Mvc.HtmlHelper<viewmodel>' does not contain a definition for 'DeleteConfirmation' and no extension method 'DeleteConfirmation' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<viewmodel>' could be found (are you missing a using directive or an assembly reference?)


Please let me know, how to access HtmlExtensions which are defined in Nop.Web.Framework.

Thanks in advance!
6 лет назад
KishorTala wrote:
Hi Folks,

I am developing plugin for customize vendor detail from admin dashboard.
For that I have overrided Edit action and view(Edit.cshtml, _CreateOrUpdate.cshtml) accordingly.
But I facing below issue when opening that page,
Unable to access htmlextensions like
   1. Html.SetActiveMenuItemSystemName("Vendors");
   2. @Html.DeleteConfirmation("vendor-delete")

below are the error,

CS1061: 'System.Web.Mvc.HtmlHelper<viewmodel>' does not contain a definition for 'DeleteConfirmation' and no extension method 'DeleteConfirmation' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<viewmodel>' could be found (are you missing a using directive or an assembly reference?)


Please let me know, how to access HtmlExtensions which are defined in Nop.Web.Framework.

Thanks in advance!


Have you added a reference to Nop.Web in your plugin?
6 лет назад
Thanks @seanrock for reply.
After adding
@using Nop.Web.Framework;
this reference, views rendering without any issue in plugin.
Nop.Web is a Web solution, we can't add this as reference in plugin.
6 лет назад
KishorTala wrote:
Thanks @seanrock for reply.
After adding
@using Nop.Web.Framework;
this reference, views rendering without any issue in plugin.
Nop.Web is a Web solution, we can't add this as reference in plugin.


Hi, yes you can add the reference to the Nop.Web project in your plugin - we do, and its necessary to override some base code.

https://www.screencast.com/t/Og2p3djmY
6 лет назад
Ok thanks, I will check this and let you know.
6 лет назад
Be sure to set the Reference's "Copy Local" property to False
6 лет назад
Hello,

Using nopCommerce 3.90 with source.

I am currently having this problem.

I have my view setup like this:


@model Nop.Plugin.Misc.LakesideImport.Models.ImportModel
@using Nop.Web.Framework
@using Nop.Core.Domain.Catalog

@{
     Layout = "~/Administration/Views/Shared/_AdminLayout.cshtml";

     //page title
     ViewBag.Title = T("Plugins.Misc.LakesideImport.Import.Page.Settings.Title").Text;

     Html.SetActiveMenuItemSystemName("LakesideXX");
}



I get the same error that Kishor shows in his opening post.

Any help would be gratefully appreciated.

Thanks,
Tony
6 лет назад
Carneno wrote:
Hello,

Using nopCommerce 3.90 with source.

I am currently having this problem.

I have my view setup like this:


@model Nop.Plugin.Misc.LakesideImport.Models.ImportModel
@using Nop.Web.Framework
@using Nop.Core.Domain.Catalog

@{
     Layout = "~/Administration/Views/Shared/_AdminLayout.cshtml";

     //page title
     ViewBag.Title = T("Plugins.Misc.LakesideImport.Import.Page.Settings.Title").Text;

     Html.SetActiveMenuItemSystemName("LakesideXX");
}



I get the same error that Kishor shows in his opening post.

Any help would be gratefully appreciated.

Thanks,
Tony


@using Nop.Web.Framework.UI
6 лет назад
Tuan,

Thanks for your help.  That using statement did fix the problem.

To tell you the truth, I don't even know what this Html.SetActiveMenuItemSystemName("LakesideXX"); does.

I had it in my view to try to follow the standards of what nopCommerce does in it's views.

Can you explain the purpose of that statement?

Thanks,
Tony
6 лет назад
The Admin System Menu (navigation) on the left side will 'highlight' the Active menu item.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.