Share via


TagHelperAttributeList.SetAttribute Method

Definition

Overloads

SetAttribute(TagHelperAttribute)

Replaces the first TagHelperAttribute with Name matching attribute's Name and removes any additional matching TagHelperAttributes. If a matching TagHelperAttribute is not found, adds the specified attribute to the end of the collection.

SetAttribute(String, Object)

Replaces the first TagHelperAttribute with Name matching name and removes any additional matching TagHelperAttributes. If a matching TagHelperAttribute is not found, adds a TagHelperAttribute with name and value to the end of the collection.

SetAttribute(TagHelperAttribute)

Source:
TagHelperAttributeList.cs
Source:
TagHelperAttributeList.cs

Replaces the first TagHelperAttribute with Name matching attribute's Name and removes any additional matching TagHelperAttributes. If a matching TagHelperAttribute is not found, adds the specified attribute to the end of the collection.

public:
 void SetAttribute(Microsoft::AspNetCore::Razor::TagHelpers::TagHelperAttribute ^ attribute);
public void SetAttribute (Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute attribute);
member this.SetAttribute : Microsoft.AspNetCore.Razor.TagHelpers.TagHelperAttribute -> unit
Public Sub SetAttribute (attribute As TagHelperAttribute)

Parameters

attribute
TagHelperAttribute

The TagHelperAttribute to set.

Remarks

attribute's Name is compared case-insensitively.

Applies to

SetAttribute(String, Object)

Source:
TagHelperAttributeList.cs
Source:
TagHelperAttributeList.cs

Replaces the first TagHelperAttribute with Name matching name and removes any additional matching TagHelperAttributes. If a matching TagHelperAttribute is not found, adds a TagHelperAttribute with name and value to the end of the collection.

public:
 void SetAttribute(System::String ^ name, System::Object ^ value);
public void SetAttribute (string name, object value);
member this.SetAttribute : string * obj -> unit
Public Sub SetAttribute (name As String, value As Object)

Parameters

name
String

The Name of the TagHelperAttribute to set.

value
Object

The Value to set.

Remarks

name is compared case-insensitively.

Applies to