---
title: "Class PartialViewComponentRenderer"
slug: "sitecore.aspnet.renderingengine.rendering.partialviewcomponentrenderer"
abstract: ""
---
# Class PartialViewComponentRenderer

An [IComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.icomponentrenderer.html) that will render Partial Views.

## Inheritance

System.Object

PartialViewComponentRenderer

### Implements

[IComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.icomponentrenderer.html)

#### **Namespace**: Sitecore.AspNet.RenderingEngine.Rendering

##### **Assembly**: Sitecore.AspNet.RenderingEngine.dll

##### Syntax

```csharp
public class PartialViewComponentRenderer : Object, IComponentRenderer

```

### Constructors

#### PartialViewComponentRenderer(String)

Initializes a new instance of the [PartialViewComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.partialviewcomponentrenderer.html) class.

##### Declaration

```csharp
public PartialViewComponentRenderer(string locator)

```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | locator | The string to use when locating the Partial View. |

### Methods

#### Describe(Predicate<String>, String)

Creates an instance of a [ComponentRendererDescriptor](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.componentrendererdescriptor.html) for the [PartialViewComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.partialviewcomponentrenderer.html) class.

##### Declaration

```csharp
public static ComponentRendererDescriptor Describe(Predicate<string> match, string locator)

```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.Predicate<br><br><<br><br>System.String<br><br>> | match | A predicate to use when attempting to match a layout component. |
| System.String | locator | The string to use when locating the Partial View. |

##### Returns

| Type | Description |
| --- | --- |
| ComponentRendererDescriptor | An instance of [ComponentRendererDescriptor](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.componentrendererdescriptor.html) that describes the [PartialViewComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.partialviewcomponentrenderer.html). |

#### Render(ISitecoreRenderingContext, ViewContext)

Generates the output HTML.

##### Declaration

```csharp
public Task<IHtmlContent> Render(ISitecoreRenderingContext renderingContext, ViewContext viewContext)

```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| ISitecoreRenderingContext | renderingContext | The current [ISitecoreRenderingContext](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.isitecorerenderingcontext.html). |
| Microsoft.AspNetCore.Mvc.Rendering.ViewContext | viewContext | The current Microsoft.AspNetCore.Mvc.Rendering.ViewContext. |

##### Returns

| Type | Description |
| --- | --- |
| System.Threading.Tasks.Task<br><br><<br><br>Microsoft.AspNetCore.Html.IHtmlContent<br><br>> | The HTML content to render. |

### Implements

[IComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.icomponentrenderer.html)
