public void RenderComponent(string componentName, IDictionary parameters) { var componentContext = new BrailViewComponentContext(this, null, componentName, OutputStream, new Hashtable(parameters, StringComparer.InvariantCultureIgnoreCase)); AddViewComponentProperties(componentContext.ComponentParameters); var componentFactory = (IViewComponentFactory)context.GetService(typeof(IViewComponentFactory)); var component = componentFactory.Create(componentName); component.Init(context, componentContext); component.Render(); if (componentContext.ViewToRender != null) { OutputSubView("/" + componentContext.ViewToRender, componentContext.ComponentParameters); } RemoveViewComponentProperties(componentContext.ComponentParameters); }
public void RenderComponent(string componentName, IDictionary parameters) { var componentContext = new BrailViewComponentContext(this, null, componentName, OutputStream, new Hashtable(parameters, StringComparer.InvariantCultureIgnoreCase)); AddViewComponentProperties(componentContext.ComponentParameters); var componentFactory = (IViewComponentFactory) context.GetService(typeof(IViewComponentFactory)); var component = componentFactory.Create(componentName); component.Init(context, componentContext); component.Render(); if (componentContext.ViewToRender != null) { OutputSubView("/" + componentContext.ViewToRender, componentContext.ComponentParameters); } RemoveViewComponentProperties(componentContext.ComponentParameters); }