i need some help.
as i am upgrading custom plugin from 4 to 4.6
i did some search and updated the plugin buisness and it compile fine now
i need to call the viewcompnent of this plugin inside custom view not core view
so i used
@await Component.InvokeAsync("PayTabsViewComponent")
inside the custom view which i am routing to it by the rout of checkout controller
routeBuilder.MapLocalizedRoute("Check-out", "checkout/",
new { controller = "Checkout", action = "PaymentCheckOut" });
and to display the component i am using
@model Nop.Plugin.Payments.PayTabs.Models.PayTabsModel
@using Nop.Core
@inject IWebHelper webHelper
@{
Layout = "_ColumnsOne";
//scripts
//Html.AddScriptParts(ResourceLocation.Footer, "~/js/public.accordion.js");
//Html.AddScriptParts(ResourceLocation.Footer, "~/js/public.onepagecheckout.js");
var storeLocation = webHelper.GetStoreLocation();
//title
Html.AddTitleParts(T("PageTitle.Checkout").Text);
//page class
Html.AppendPageCssClassParts("html-checkout-page");
}
<div class="page checkout-page">
<div class="page-title">
<h1>@T("Checkout")</h1>
</div>
<div class="page-body checkout-data">
@if (TempData["CartIsEmpty"] == null)
{
@await Component.InvokeAsync("PayTabsViewComponent")
}
else
{
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4><span class="glyphicon glyphicon-warning-sign"></span> @T("Common.Warning")</h4>
@TempData["ErrorMessage"]
</div>
}
</div>
<script type="text/javascript" asp-location="Footer">
</script>
</div>
and i am getting this error
InvalidOperationException: A view component named 'PayTabsViewComponent' could not be found. A view component must be a public non-abstract class, not contain any generic parameters, and either be decorated with 'ViewComponentAttribute' or have a class name ending with the 'ViewComponent' suffix. A view component must not be decorated with 'NonViewComponentAttribute'.
can you help me?