TagHelperAttributeValueCodeRenderer.RenderAttributeValue Method

Definition

Called during Razor's code generation process to generate code that instantiates the value of the tag helper's property. Last value written should not be or end with a semicolon.

public:
 virtual void RenderAttributeValue(Microsoft::AspNetCore::Razor::Compilation::TagHelpers::TagHelperAttributeDescriptor ^ attributeDescriptor, Microsoft::AspNetCore::Razor::CodeGenerators::CSharpCodeWriter ^ writer, Microsoft::AspNetCore::Razor::CodeGenerators::CodeGeneratorContext ^ context, Action<Microsoft::AspNetCore::Razor::CodeGenerators::CSharpCodeWriter ^> ^ renderAttributeValue, bool complexValue);
public virtual void RenderAttributeValue (Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperAttributeDescriptor attributeDescriptor, Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter writer, Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext context, Action<Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter> renderAttributeValue, bool complexValue);
abstract member RenderAttributeValue : Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperAttributeDescriptor * Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter * Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext * Action<Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter> * bool -> unit
override this.RenderAttributeValue : Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperAttributeDescriptor * Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter * Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext * Action<Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter> * bool -> unit
Public Overridable Sub RenderAttributeValue (attributeDescriptor As TagHelperAttributeDescriptor, writer As CSharpCodeWriter, context As CodeGeneratorContext, renderAttributeValue As Action(Of CSharpCodeWriter), complexValue As Boolean)

Parameters

attributeDescriptor
TagHelperAttributeDescriptor

The TagHelperAttributeDescriptor to generate code for.

writer
CSharpCodeWriter

The CSharpCodeWriter that's used to write code.

context
CodeGeneratorContext

A ChunkGeneratorContext instance that contains information about the current code generation process.

renderAttributeValue
Action<CSharpCodeWriter>

Action that renders the raw value of the HTML attribute.

complexValue
Boolean

Indicates whether or not the source attribute value contains more than simple text. false for plain C# expressions e.g. "PropertyName". true if the attribute value contain at least one in-line Razor construct e.g. "@(@readonly)".

Applies to