TagHelperOutputExtensions.CopyHtmlAttribute 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將使用者提供的屬性從 context
的 AllAttributes 複製到 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)
參數
- tagHelperOutput
- TagHelperOutput
TagHelperOutput這個方法會擴充。
- attributeName
- String
系結屬性的名稱。
- context
- TagHelperContext
備註
如果 tagHelperOutput
Attributes 的 不包含具有指定 attributeName
的屬性,則只會複製 屬性。
在 或 AllAttributestagHelperOutput
Attributes 中 context
,重複的屬性名稱可能會導致複製的屬性順序未維護。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應