IHtmlGenerator.GenerateLabel Method

Definition

Generate a <label> element

public:
 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 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
Public Function GenerateLabel (viewContext As ViewContext, modelExplorer As ModelExplorer, expression As String, labelText As String, htmlAttributes As Object) As TagBuilder

Parameters

viewContext
ViewContext

A ViewContext instance for the current scope.

modelExplorer
ModelExplorer

The ModelExplorer for the expression.

expression
String

Expression name, relative to the current model. Used to set the target of the label.

labelText
String

Text used to render this label.

htmlAttributes
Object

An Object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the Object. This Object is typically created using Object initializer syntax. Alternatively, an IDictionary<TKey,TValue> instance containing the route parameters.

Returns

Applies to