共用方式為


DefaultHtmlGenerator.GenerateLabel 方法

定義

<產生標籤 > 專案

public:
 virtual Microsoft::AspNetCore::Mvc::Rendering::TagBuilder ^ GenerateLabel(Microsoft::AspNetCore::Mvc::Rendering::ViewContext ^ viewContext, Microsoft::AspNetCore::Mvc::ViewFeatures::ModelExplorer ^ modelExplorer, System::String ^ expression, System::String ^ labelText, System::Object ^ htmlAttributes);
public virtual Microsoft.AspNetCore.Mvc.Rendering.TagBuilder GenerateLabel (Microsoft.AspNetCore.Mvc.Rendering.ViewContext viewContext, Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer modelExplorer, string expression, string labelText, object htmlAttributes);
abstract member GenerateLabel : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string * string * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
override this.GenerateLabel : Microsoft.AspNetCore.Mvc.Rendering.ViewContext * Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer * string * string * obj -> Microsoft.AspNetCore.Mvc.Rendering.TagBuilder
Public Overridable Function GenerateLabel (viewContext As ViewContext, modelExplorer As ModelExplorer, expression As String, labelText As String, htmlAttributes As Object) As TagBuilder

參數

viewContext
ViewContext

ViewContext目前範圍的實例。

modelExplorer
ModelExplorer

ModelExplorerexpression

expression
String

相對於目前模型的運算式名稱。 用來設定標籤的目標。

labelText
String

用來轉譯此標籤的文字。

htmlAttributes
Object

Object,包含路由的參數。 參數會透過反映來擷取,方法是檢查 的屬性 Object 。 這 Object 通常是使用 Object 初始化運算式語法所建立。 或者,包含 IDictionary<TKey,TValue> 路由參數的實例。

傳回

實作

適用於