Try our conversational search powered by Generative AI!

Class ViewExtensions

Extensions to System.Web.Mvc.IView and System.Web.Mvc.HtmlHelper regarding rendering.

Inheritance
System.Object
ViewExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Web.Mvc
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public static class ViewExtensions

Methods

Render<T>(IView, ViewEngineResult, ViewContext, TextWriter, T)

Renders a view on the stream

Declaration
public static void Render<T>(this IView view, ViewEngineResult viewEngineResult, ViewContext context, TextWriter writer, T data)
Parameters
Type Name Description
System.Web.Mvc.IView view
System.Web.Mvc.ViewEngineResult viewEngineResult

The result from a view search

System.Web.Mvc.ViewContext context

The context of the current view

System.IO.TextWriter writer

The writer to write to

T data

Data to add to the context

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
System.Web.Mvc.HtmlHelper 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.