Class ViewExtensions
Extensions to Microsoft.
Inheritance
System.Object
ViewExtensions
Namespace: EPiServer.Web.Mvc
Assembly: EPiServer.Cms.AspNetCore.Mvc.dll
Version: 12.0.3Syntax
public static class ViewExtensions : Object
Methods
RenderAsync<T>(IView, ViewEngineResult, ViewContext, TextWriter, T)
Renders a view on the stream
Declaration
public static Task RenderAsync<T>(this IView view, ViewEngineResult viewEngineResult, ViewContext context, TextWriter writer, T data)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
view | |
Microsoft. |
viewEngineResult | The result from a view search |
Microsoft. |
context | The context of the current view |
System. |
writer | The writer to write to |
T | data | Data to add to the context |
Returns
Type | Description |
---|---|
System. |
Type Parameters
Name | Description |
---|---|
T |
RenderPartial<T>(HtmlHelper, T)
Renders a partial view of the specified model.
Declaration
public static void RenderPartial<T>(this HtmlHelper helper, T model)
Parameters
Type | Name | Description |
---|---|---|
Microsoft. |
helper | The html helper that this method extends. |
T | model | The model to render. |
Type Parameters
Name | Description |
---|---|
T | The type of model to render. |
Remarks
This method will try to find a partial view that matches the name of the type T
and use that to render the specified model
.