diff --git a/src/Presentation/Nop.Web.Framework/Controllers/BaseController.cs b/src/Presentation/Nop.Web.Framework/Controllers/BaseController.cs index 0974dd134e2..57ddab6bb19 100644 --- a/src/Presentation/Nop.Web.Framework/Controllers/BaseController.cs +++ b/src/Presentation/Nop.Web.Framework/Controllers/BaseController.cs @@ -41,8 +41,9 @@ public abstract class BaseController : Controller /// Render component to string /// /// Component name + /// Arguments /// Result - protected virtual string RenderViewComponentToString(string componentName) + protected virtual string RenderViewComponentToString(string componentName, object arguments = null) { //original implementation: https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.ViewFeatures/Internal/ViewComponentResultExecutor.cs //we customized it to allow running from controllers @@ -57,7 +58,7 @@ protected virtual string RenderViewComponentToString(string componentName) var context = actionContextAccessor.ActionContext; - var viewComponentResult = ViewComponent(componentName); + var viewComponentResult = ViewComponent(componentName, arguments); var viewData = this.ViewData; if (viewData == null)