ViewContext Constructors

Definition

Overloads

ViewContext()

Source:
ViewContext.cs
Source:
ViewContext.cs
Source:
ViewContext.cs

Creates an empty ViewContext.

C#
public ViewContext ();

Remarks

The default constructor is provided for unit test purposes only.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

ViewContext(ViewContext, IView, ViewDataDictionary, TextWriter)

Source:
ViewContext.cs
Source:
ViewContext.cs
Source:
ViewContext.cs

Initializes a new instance of ViewContext.

C#
public ViewContext (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, Microsoft.AspNetCore.Mvc.ViewEngines.IView view, Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary viewData, System.IO.TextWriter writer);

Parameters

viewContext
ViewContext

The ViewContext to copy values from.

view
IView

The IView being rendered.

writer
TextWriter

The TextWriter to render output to.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

ViewContext(ActionContext, IView, ViewDataDictionary, ITempDataDictionary, TextWriter, HtmlHelperOptions)

Source:
ViewContext.cs
Source:
ViewContext.cs
Source:
ViewContext.cs

Initializes a new instance of ViewContext.

C#
public ViewContext (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ViewEngines.IView view, Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary viewData, Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary tempData, System.IO.TextWriter writer, Microsoft.AspNetCore.Mvc.ViewFeatures.HtmlHelperOptions htmlHelperOptions);

Parameters

actionContext
ActionContext

The ActionContext.

view
IView

The IView being rendered.

writer
TextWriter

The TextWriter to render output to.

htmlHelperOptions
HtmlHelperOptions

The HtmlHelperOptions to apply to this instance.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0