MvcTagHelperAttributeValueCodeRenderer.RenderAttributeValue Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for