Sdílet prostřednictvím


TagHelperOutputExtensions.CopyHtmlAttribute Metoda

Definice

Zkopíruje atribut zadaný uživatelem z context's AllAttributes na tagHelperOutput's 's ' s 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)

Parametry

tagHelperOutput
TagHelperOutput

Tato TagHelperOutput metoda rozšiřuje.

attributeName
String

Název vázaného atributu.

Poznámky

Zkopíruje atribut pouze v případě tagHelperOutput, že s Attributes neobsahuje atribut s daným attributeNameatributem .

Duplicitní atributy se stejnými názvy v context's AllAttributes nebo tagHelperOutput's Attributes mohou vést k tomu, že pořadí zkopírovaných atributů nebude zachováno.

Platí pro