Skip to content

GeneratedHtmlResult Class

Provides a base class for action results that generate HTML content.

C#
public abstract class GeneratedHtmlResult : Microsoft.AspNetCore.Mvc.ActionResult, Microsoft.AspNetCore.Mvc.Infrastructure.IStatusCodeActionResult, Microsoft.AspNetCore.Mvc.IActionResult

Inheritance System.ObjectMicrosoft.AspNetCore.Mvc.ActionResult → GeneratedHtmlResult

Implements Microsoft.AspNetCore.Mvc.Infrastructure.IStatusCodeActionResult, Microsoft.AspNetCore.Mvc.IActionResult

Remarks

This abstract class is designed to be inherited by classes that need to dynamically generate HTML content as an action result. It sets various HTTP headers to ensure that the generated content is not cached and is served as HTML.

Methods

GeneratedHtmlResult.ExecuteResultAsync(ActionContext) Method

Asynchronously executes the result operation of the action method, setting HTTP headers and writing the HTML content to the response.

C#
public override System.Threading.Tasks.Task ExecuteResultAsync(Microsoft.AspNetCore.Mvc.ActionContext context);

Parameters

context Microsoft.AspNetCore.Mvc.ActionContext

The action context for the current request.

Implements ExecuteResultAsync(ActionContext)

Returns

System.Threading.Tasks.Task