ViewViewComponentResult Class¶
Summary¶
A [Microsoft.AspNet.Mvc.IViewComponentResult](Microsoft.AspNet.Mvc.IViewComponentResult.yml) that renders a partial view when executed.
Properties¶
-
TempData
()¶ Gets or sets the [Microsoft.AspNet.Mvc.ITempDataDictionary]() instance.
Return type: Microsoft.AspNet.Mvc.ITempDataDictionary public ITempDataDictionary TempData { get; set; }
-
ViewData
()¶ Gets or sets the [Microsoft.AspNet.Mvc.ViewDataDictionary](Microsoft.AspNet.Mvc.ViewDataDictionary.yml).
Return type: Microsoft.AspNet.Mvc.ViewDataDictionary public ViewDataDictionary ViewData { get; set; }
-
ViewEngine
()¶ Gets or sets the [Microsoft.AspNet.Mvc.ViewViewComponentResult.ViewEngine](Microsoft.AspNet.Mvc.ViewViewComponentResult.yml).
Return type: Microsoft.AspNet.Mvc.Rendering.IViewEngine public IViewEngine ViewEngine { get; set; }
-
ViewName
()¶ Gets or sets the view name.
Return type: System.String public string ViewName { get; set; }
-
Methods¶
-
Execute
(Microsoft.AspNet.Mvc.ViewComponentContext)¶ Locates and renders a view specified by [Microsoft.AspNet.Mvc.ViewViewComponentResult.ViewName](Microsoft.AspNet.Mvc.ViewViewComponentResult.yml). If [Microsoft.AspNet.Mvc.ViewViewComponentResult.ViewName](Microsoft.AspNet.Mvc.ViewViewComponentResult.yml) is <c>null</c>, then the view name searched for is <c>”Default”</c>.
Arguments: - context (Microsoft.AspNet.Mvc.ViewComponentContext) – The [Microsoft.AspNet.Mvc.ViewComponentContext](Microsoft.AspNet.Mvc.ViewComponentContext.yml) for the current component execution.
public void Execute(ViewComponentContext context)
-
ExecuteAsync
(Microsoft.AspNet.Mvc.ViewComponentContext)¶ Locates and renders a view specified by [Microsoft.AspNet.Mvc.ViewViewComponentResult.ViewName](Microsoft.AspNet.Mvc.ViewViewComponentResult.yml). If [Microsoft.AspNet.Mvc.ViewViewComponentResult.ViewName](Microsoft.AspNet.Mvc.ViewViewComponentResult.yml) is <c>null</c>, then the view name searched for is <c>”Default”</c>.
Arguments: - context (Microsoft.AspNet.Mvc.ViewComponentContext) – The [Microsoft.AspNet.Mvc.ViewComponentContext](Microsoft.AspNet.Mvc.ViewComponentContext.yml) for the current component execution.
Return type: System.Threading.Tasks.Task
Returns: A [System.Threading.Tasks.Task]() which will complete when view rendering is completed.
public Task ExecuteAsync(ViewComponentContext context)
-