ContentViewComponentResult Class¶
Summary¶
An [Microsoft.AspNet.Mvc.IViewComponentResult](Microsoft.AspNet.Mvc.IViewComponentResult.yml) which writes text when executed.
Constructors¶
-
ContentViewComponentResult
(Microsoft.AspNet.Mvc.Rendering.HtmlString)¶ Initializes a new [Microsoft.AspNet.Mvc.ContentViewComponentResult](Microsoft.AspNet.Mvc.ContentViewComponentResult.yml).
Arguments: - encodedContent (Microsoft.AspNet.Mvc.Rendering.HtmlString) –
public ContentViewComponentResult(HtmlString encodedContent)
-
ContentViewComponentResult
(System.String) Initializes a new [Microsoft.AspNet.Mvc.ContentViewComponentResult](Microsoft.AspNet.Mvc.ContentViewComponentResult.yml).
Arguments: - content (System.String) – Content to write. The content be HTML encoded when output.
public ContentViewComponentResult(string content)
-
Methods¶
-
Execute
(Microsoft.AspNet.Mvc.ViewComponentContext)¶ Writes the [Microsoft.AspNet.Mvc.ContentViewComponentResult.EncodedContent](Microsoft.AspNet.Mvc.ContentViewComponentResult.yml).
Arguments: - context (Microsoft.AspNet.Mvc.ViewComponentContext) – The [Microsoft.AspNet.Mvc.ViewComponentContext](Microsoft.AspNet.Mvc.ViewComponentContext.yml).
public void Execute(ViewComponentContext context)
-
ExecuteAsync
(Microsoft.AspNet.Mvc.ViewComponentContext)¶ Writes the [Microsoft.AspNet.Mvc.ContentViewComponentResult.EncodedContent](Microsoft.AspNet.Mvc.ContentViewComponentResult.yml).
Arguments: - context (Microsoft.AspNet.Mvc.ViewComponentContext) – The [Microsoft.AspNet.Mvc.ViewComponentContext](Microsoft.AspNet.Mvc.ViewComponentContext.yml).
Return type: System.Threading.Tasks.Task
Returns: A completed [System.Threading.Tasks.Task]().
public Task ExecuteAsync(ViewComponentContext context)
-