RenderTreeBuilder.AddAttribute Method

Definition

Overloads

AddAttribute(Int32, RenderTreeFrame)

Appends a frame representing an attribute.

The attribute is associated with the most recently added element.

AddAttribute(Int32, RenderTreeFrame)

Appends a frame representing an attribute.

The attribute is associated with the most recently added element.

AddAttribute(Int32, String)

Appends a frame representing a bool-valued attribute with value 'true'.

The attribute is associated with the most recently added element.

AddAttribute(Int32, String, EventCallback)

Appends a frame representing an EventCallback attribute.

The attribute is associated with the most recently added element. If the value is null and the current element is not a component, the frame will be omitted.

AddAttribute(Int32, String, Boolean)

Appends a frame representing a bool-valued attribute.

The attribute is associated with the most recently added element. If the value is false and the current element is not a component, the frame will be omitted.

AddAttribute(Int32, String, MulticastDelegate)

Appends a frame representing a delegate-valued attribute.

The attribute is associated with the most recently added element. If the value is null and the current element is not a component, the frame will be omitted.

AddAttribute(Int32, String, Object)

Appends a frame representing a string-valued attribute. The attribute is associated with the most recently added element. If the value is null, or the Boolean value false and the current element is not a component, the frame will be omitted.

AddAttribute(Int32, String, String)

Appends a frame representing a string-valued attribute.

The attribute is associated with the most recently added element. If the value is null and the current element is not a component, the frame will be omitted.

AddAttribute<TArgument>(Int32, String, EventCallback<TArgument>)

Appends a frame representing an EventCallback attribute.

The attribute is associated with the most recently added element. If the value is null and the current element is not a component, the frame will be omitted.

AddAttribute(Int32, RenderTreeFrame)

Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs

Appends a frame representing an attribute.

The attribute is associated with the most recently added element.

C#
public void AddAttribute (int sequence, Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame frame);

Parameters

sequence
Int32

An integer that represents the position of the instruction in the source code.

frame
RenderTreeFrame

A RenderTreeFrame holding the name and value of the attribute.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 5.0, 6.0, 7.0, 8.0, 9.0

AddAttribute(Int32, RenderTreeFrame)

Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs

Appends a frame representing an attribute.

The attribute is associated with the most recently added element.

C#
public void AddAttribute (int sequence, in Microsoft.AspNetCore.Components.RenderTree.RenderTreeFrame frame);

Parameters

sequence
Int32

An integer that represents the position of the instruction in the source code.

frame
RenderTreeFrame

A RenderTreeFrame holding the name and value of the attribute.

Applies to

ASP.NET Core 3.1 and ASP.NET Core 3.0
Product Versions
ASP.NET Core 3.0, 3.1

AddAttribute(Int32, String)

Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs

Appends a frame representing a bool-valued attribute with value 'true'.

The attribute is associated with the most recently added element.

C#
public void AddAttribute (int sequence, string name);

Parameters

sequence
Int32

An integer that represents the position of the instruction in the source code.

name
String

The name of the attribute.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 5.0, 6.0, 7.0, 8.0, 9.0

AddAttribute(Int32, String, EventCallback)

Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs

Appends a frame representing an EventCallback attribute.

The attribute is associated with the most recently added element. If the value is null and the current element is not a component, the frame will be omitted.

C#
public void AddAttribute (int sequence, string name, Microsoft.AspNetCore.Components.EventCallback value);

Parameters

sequence
Int32

An integer that represents the position of the instruction in the source code.

name
String

The name of the attribute.

value
EventCallback

The value of the attribute.

Remarks

This method is provided for infrastructure purposes, and is used to support generated code that uses EventCallbackFactory.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

AddAttribute(Int32, String, Boolean)

Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs

Appends a frame representing a bool-valued attribute.

The attribute is associated with the most recently added element. If the value is false and the current element is not a component, the frame will be omitted.

C#
public void AddAttribute (int sequence, string name, bool value);

Parameters

sequence
Int32

An integer that represents the position of the instruction in the source code.

name
String

The name of the attribute.

value
Boolean

The value of the attribute.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

AddAttribute(Int32, String, MulticastDelegate)

Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs

Appends a frame representing a delegate-valued attribute.

The attribute is associated with the most recently added element. If the value is null and the current element is not a component, the frame will be omitted.

C#
public void AddAttribute (int sequence, string name, MulticastDelegate value);
C#
public void AddAttribute (int sequence, string name, MulticastDelegate? value);

Parameters

sequence
Int32

An integer that represents the position of the instruction in the source code.

name
String

The name of the attribute.

value
MulticastDelegate

The value of the attribute.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

AddAttribute(Int32, String, Object)

Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs

Appends a frame representing a string-valued attribute. The attribute is associated with the most recently added element. If the value is null, or the Boolean value false and the current element is not a component, the frame will be omitted.

C#
public void AddAttribute (int sequence, string name, object value);
C#
public void AddAttribute (int sequence, string name, object? value);

Parameters

sequence
Int32

An integer that represents the position of the instruction in the source code.

name
String

The name of the attribute.

value
Object

The value of the attribute.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

AddAttribute(Int32, String, String)

Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs

Appends a frame representing a string-valued attribute.

The attribute is associated with the most recently added element. If the value is null and the current element is not a component, the frame will be omitted.

C#
public void AddAttribute (int sequence, string name, string value);
C#
public void AddAttribute (int sequence, string name, string? value);

Parameters

sequence
Int32

An integer that represents the position of the instruction in the source code.

name
String

The name of the attribute.

value
String

The value of the attribute.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

AddAttribute<TArgument>(Int32, String, EventCallback<TArgument>)

Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs
Source:
RenderTreeBuilder.cs

Appends a frame representing an EventCallback attribute.

The attribute is associated with the most recently added element. If the value is null and the current element is not a component, the frame will be omitted.

C#
public void AddAttribute<TArgument> (int sequence, string name, Microsoft.AspNetCore.Components.EventCallback<TArgument> value);

Type Parameters

TArgument

Parameters

sequence
Int32

An integer that represents the position of the instruction in the source code.

name
String

The name of the attribute.

value
EventCallback<TArgument>

The value of the attribute.

Remarks

This method is provided for infrastructure purposes, and is used to support generated code that uses EventCallbackFactory.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0