MvcTagHelperAttributeValueCodeRenderer.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:
 override void RenderAttributeValue(Microsoft::AspNetCore::Razor::Compilation::TagHelpers::TagHelperAttributeDescriptor ^ attributeDescriptor, Microsoft::AspNetCore::Razor::CodeGenerators::CSharpCodeWriter ^ writer, Microsoft::AspNetCore::Razor::CodeGenerators::CodeGeneratorContext ^ codeGeneratorContext, Action<Microsoft::AspNetCore::Razor::CodeGenerators::CSharpCodeWriter ^> ^ renderAttributeValue, bool complexValue);
public override void RenderAttributeValue (Microsoft.AspNetCore.Razor.Compilation.TagHelpers.TagHelperAttributeDescriptor attributeDescriptor, Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter writer, Microsoft.AspNetCore.Razor.CodeGenerators.CodeGeneratorContext codeGeneratorContext, Action<Microsoft.AspNetCore.Razor.CodeGenerators.CSharpCodeWriter> renderAttributeValue, bool complexValue);
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 Overrides Sub RenderAttributeValue (attributeDescriptor As TagHelperAttributeDescriptor, writer As CSharpCodeWriter, codeGeneratorContext 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.

codeGeneratorContext
CodeGeneratorContext
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)".

Remarks

If the attribute being rendered is of the type ModelExpressionTypeName, then a model expression will be created by calling into CreateModelExpressionMethodName.

Applies to