Facility for rendering a partial template from a tag helper #5504
When creating a custom TagHelper it would be convenient to be able to render an existing partial view programatically and capture the rendered result in a string or an HtmlContent object inside the TagHelper.Process method.
For example, consider the following hypothetical custom TagHelper
This tag helper inherits from the hypothetical TemplateRenderingTagHelper abstract class, this class would look like this:
As you can see this class makes available the HtmlHelper property for its sub classes, the HtmlHelper.Partial (or PartialAsync) can then be used to generate a template.
Even if it is possible to call
The text was updated successfully, but these errors were encountered:
It will be automatically bound to your View ViewContext
Done! Now you have a working HtmlHelper.