Compartir a través de


TagHelperOutputExtensions.CopyHtmlAttribute Método

Definición

Copia un atributo proporcionado por el usuario de contextlos de AllAttributes a tagHelperOutput.Attributes

public:
[System::Runtime::CompilerServices::Extension]
 static void CopyHtmlAttribute(Microsoft::AspNetCore::Razor::TagHelpers::TagHelperOutput ^ tagHelperOutput, System::String ^ attributeName, Microsoft::AspNetCore::Razor::TagHelpers::TagHelperContext ^ context);
public static void CopyHtmlAttribute (this Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutput tagHelperOutput, string attributeName, Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext context);
static member CopyHtmlAttribute : Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutput * string * Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext -> unit
<Extension()>
Public Sub CopyHtmlAttribute (tagHelperOutput As TagHelperOutput, attributeName As String, context As TagHelperContext)

Parámetros

tagHelperOutput
TagHelperOutput

Este TagHelperOutput método se extiende.

attributeName
String

Nombre del atributo enlazado.

Comentarios

Solo copia el atributo si tagHelperOutput's Attributes no contiene un atributo con el especificado attributeName.

Los atributos duplicados del mismo nombre en contextlos objetos o AllAttributestagHelperOutputde Attributes pueden dar lugar a que no se mantenga el orden de atributo copiado.

Se aplica a